// RUN: %clang_cc1 %s -fsyntax-only -verify namespace CurrentInstantiation { template struct A0 { // expected-note 6{{definition of 'A0' is not complete until the closing '}'}} struct B0 : A0 { }; // expected-error {{base class has incomplete type}} template struct B1 : A0 { }; // expected-error {{base class has incomplete type}} struct B2; template struct B3; struct B4 { // expected-note 2{{definition of 'CurrentInstantiation::A0::B4' is not complete until the closing '}'}} struct C0 : A0, B4 { }; // expected-error 2{{base class has incomplete type}} template struct C1 : A0, B4 { }; // expected-error 2{{base class has incomplete type}} struct C2; template struct C3; }; template struct B5 { // expected-note 2{{definition of 'B5' is not complete until the closing '}'}} struct C0 : A0, B5 { }; // expected-error 2{{base class has incomplete type}} template struct C1 : A0, B5 { }; // expected-error 2{{base class has incomplete type}} struct C2; template struct C3; }; }; template struct A0::B2 : A0 { }; template template struct A0::B3 : A0 { }; template struct A0::B4::C2 : A0, B4 { }; template template struct A0::B4::C3 : A0, B4 { }; template template struct A0::B5::C2 : A0, B5 { }; template template template struct A0::B5::C3 : A0, B5 { }; template struct A0 { // expected-note 2{{definition of 'A0' is not complete until the closing '}'}} struct B0 : A0 { }; // expected-error {{base class has incomplete type}} template struct B1 : A0 { }; // expected-error {{base class has incomplete type}} struct B2; template struct B3; }; template struct A0::B2 : A0 { }; template template struct A0::B3 : A0 { }; } // namespace CurrentInstantiation namespace MemberOfCurrentInstantiation { template struct A0 { struct B : B { }; // expected-error {{base class has incomplete type}} // expected-note@-1 {{definition of 'MemberOfCurrentInstantiation::A0::B' is not complete until the closing '}'}} template struct C : C { }; // expected-error {{base class has incomplete type}} // expected-note@-1 {{definition of 'C' is not complete until the closing '}'}} }; template struct A1 { struct B; // expected-note {{definition of 'MemberOfCurrentInstantiation::A1::B' is not complete until the closing '}'}} struct C : B { }; // expected-error {{base class has incomplete type}} struct B : C { }; // expected-note {{in instantiation of member class 'MemberOfCurrentInstantiation::A1::C' requested here}} }; template struct A1; // expected-note {{in instantiation of member class 'MemberOfCurrentInstantiation::A1::B' requested here}} template<> struct A1::B { static constexpr bool f() { return true; } }; static_assert(A1::C::f()); } // namespace MemberOfCurrentInstantiation