// RUN: %clang_cc1 -fsyntax-only -verify -std=c++17 %s template struct A { A(void *) {} T(A){}; // expected-error{{member 'A' cannot have template arguments}}\ // expected-error2{{member 'A' has the same name as its class}} }; // Don't crash. A instantiate1() { return {nullptr}; } // expected-note{{in instantiation of template class 'A' requested here}} template struct B { B(void *) {} T B{}; // expected-error{{member 'B' cannot have template arguments}}\ // expected-error2{{member 'B' has the same name as its class}} }; // Don't crash. B instantiate2() { return {nullptr}; } // expected-note{{in instantiation of template class 'B' requested here}} template struct S {}; template struct C { C(void *) {} T S{}; // expected-error{{member 'S' cannot have template arguments}} }; // Don't crash. C instantiate3() { return {nullptr}; } template typename U> class D { public: D(void *) {} T(D>) {} // expected-error{{member 'D' cannot have template arguments}}\ // expected-error{{expected ';' at end of declaration list}}\ // expected-error2{{member 'D' has the same name as its class}} }; // Don't crash. D instantiate4() { return D(nullptr); } // expected-note{{in instantiation of template class 'D' requested here}}