1 // RUN: %clang_cc1 -fsyntax-only -verify %s 2 3 // PR5741 4 namespace test0 { 5 struct A { 6 struct B { }; 7 struct C; 8 }; 9 10 struct A::C : B { }; 11 } 12 13 // Test that successive base specifiers don't screw with each other. 14 namespace test1 { 15 struct Opaque1 {}; 16 struct Opaque2 {}; 17 18 struct A { 19 struct B { B(Opaque1); }; 20 }; 21 struct B { 22 B(Opaque2); 23 }; 24 25 struct C : A, B { 26 // Apparently the base-or-member lookup is actually ambiguous 27 // without this qualification. 28 C() : A(), test1::B(Opaque2()) {} 29 }; 30 } 31 32 // Test that we don't find the injected class name when parsing base 33 // specifiers. 34 namespace test2 { 35 template <class T> struct bar {}; 36 template <class T> struct foo : bar<foo> {}; // expected-error {{use of class template foo requires template arguments}} expected-note {{template is declared here}} 37 } 38