1 // RUN: clang-cc -fsyntax-only -verify %s
4 short i; // expected-note 2{{candidate found by name lookup is 'A::i'}}
6 long i; // expected-note{{candidate found by name lookup is 'A::B::i'}}
7 void f() {} // expected-note{{candidate function}}
10 expected-note{{candidate found by name lookup is 'A::B::E'}}
13 namespace E {} // expected-note{{candidate found by name lookup is 'A::E'}}
18 expected-note{{candidate found by name lookup is 'A::C::E'}}
21 void f() {} // expected-note{{candidate function}}
31 int a[sizeof(i) == sizeof(char)? 1 : -1]; // okay
40 (void) i; // expected-error{{reference to 'i' is ambiguous}}
41 f(); // expected-error{{call to 'f' is ambiguous}}
45 using namespace E; // expected-error{{reference to 'E' is ambiguous}}
48 struct K2 {}; // expected-note{{candidate found by name lookup is 'A::K2'}}
51 struct K2 {}; // expected-note{{candidate found by name lookup is 'K2'}}
55 void K1::foo() {} // okay
57 // FIXME: Do we want err_ovl_no_viable_function_in_init here?
58 struct K2 k2; // expected-error{{reference to 'K2' is ambiguous}} \
59 expected-error{{incomplete type}}
61 // FIXME: This case is incorrectly diagnosed!
65 class X { // expected-note{{candidate found by name lookup is 'X'}}
66 // FIXME: produce a suitable error message for this
67 using namespace A; // expected-error{{not allowed}}
76 int i(); // expected-note{{candidate found by name lookup is 'Ni::i'}}
84 return i; // expected-error{{reference to 'i' is ambiguous}}
89 struct X; // expected-note{{candidate found by name lookup is 'OneTag::X'}}
92 namespace OneFunction {
93 void X(); // expected-note{{candidate found by name lookup is 'OneFunction::X'}}
97 struct X; // expected-note{{candidate found by name lookup is 'TwoTag::X'}}
100 namespace FuncHidesTagAmbiguity {
101 using namespace OneTag;
102 using namespace OneFunction;
103 using namespace TwoTag;
106 (void)X(); // expected-error{{reference to 'X' is ambiguous}}