1 // RUN: %clang_cc1 -fsyntax-only -verify %s
8 void f(X
); // expected-note 2 {{'N::f' declared here}}
9 void g(X
); // expected-note{{candidate function}}
11 void test_multiadd(X x
) {
22 void test_operator_adl(N::X x
, M::Y y
) {
27 void test_func_adl(N::X x
, M::Y y
) {
30 (f
)(x
); // expected-error{{too many arguments to function call, expected 0, have 1; did you mean 'N::f'?}}
31 ::f(x
); // expected-error{{too many arguments to function call, expected 0, have 1; did you mean 'N::f'?}}
35 void test_multiadd2(X x
) {
41 void test_func_adl_only(N::X x
) {
46 int g(N::X
); // expected-note{{candidate function}}
49 g(x
); // expected-error{{call to 'g' is ambiguous}}
53 g(x
); // okay; calls locally-declared function, no ADL
58 void test_operator_name_adl(N::X x
) {
59 (void)operator+(x
, x
);
67 void test_global_scope_adl(Z z
) {
78 void h(L
); // expected-note{{candidate function}}
81 void h(L
); // expected-note{{candidate function}}
82 void test_transparent_context_adl(L l
) {
84 h(l
); // expected-error {{call to 'h' is ambiguous}}
92 void foo(void (*)(A
&));
101 // PR6762: __builtin_va_list should be invisible to ADL on all platforms.
102 void test6_function(__builtin_va_list
&argv
);
104 void test6_function(__builtin_va_list
&argv
);
107 __builtin_va_list args
;
108 test6_function(args
);
112 // PR13682: we might need to instantiate class temploids.
116 void test7_function(A
&);
118 template <class T
> class B
: public inner::A
{};
120 void test(B
<int> &ref
) {
125 // Like test7, but ensure we don't complain if the type is properly
128 template <class T
> class B
;
129 void test8_function(B
<int> &);
131 void test(B
<int> &ref
) {
138 // [...] Typedef names and using-declarations used to specify the types
139 // do not contribute to this set.
140 namespace typedef_names_and_using_declarations
{
141 namespace N
{ struct S
{}; void f(S
); }
142 namespace M
{ typedef N::S S
; void g1(S
); } // expected-note {{declared here}}
143 namespace L
{ using N::S
; void g2(S
); } // expected-note {{declared here}}
147 g1(s
); // expected-error {{use of undeclared}}
148 g2(s
); // expected-error {{use of undeclared}}