[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / CXX / basic / basic.lookup / basic.lookup.argdep / p3.cpp
blob88e06fc9ae6cedb49030b2c8c48006e5b306bdae
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 // FIXME: embellish
5 namespace test0 {
6 namespace A {
7 class Foo {
8 };
10 void foo(const Foo &foo);
13 class Test {
14 enum E { foo = 0 };
16 void test() {
17 foo(A::Foo()); // expected-error {{not a function}}
22 // If X contains [...] then Y is empty.
23 // - a declaration of a class member
24 namespace test_adl_suppression_by_class_member {
25 namespace N {
26 struct T {};
27 void f(T); // expected-note {{declared here}}
29 struct S {
30 void f();
31 void test() {
32 N::T t;
33 f(t); // expected-error {{too many arguments}}
38 // - a block-scope function declaration that is not a using-declaration
39 namespace test_adl_suppression_by_block_scope {
40 namespace N {
41 struct S {};
42 void f(S);
44 namespace M { void f(int); } // expected-note 2{{candidate}}
45 void test1() {
46 N::S s;
47 using M::f;
48 f(s); // ok
51 void test2() {
52 N::S s;
53 extern void f(char); // expected-note {{passing argument to parameter here}}
54 f(s); // expected-error {{no viable conversion from 'N::S' to 'char'}}
57 void test3() {
58 N::S s;
59 extern void f(char); // expected-note {{candidate}}
60 using M::f;
61 f(s); // expected-error {{no matching function}}
64 void test4() {
65 N::S s;
66 using M::f;
67 extern void f(char); // expected-note {{candidate}}
68 f(s); // expected-error {{no matching function}}
73 // - a declaration that is neither a function nor a function template
74 namespace test_adl_suppression_by_non_function {
75 namespace N {
76 struct S {};
77 void f(S);
79 void test() {
80 extern void (*f)();
81 N::S s;
82 f(s); // expected-error {{too many arguments}}