// RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s template int x; template static int x; template<> static int x; // expected-warning {{explicit specialization cannot have a storage class}} template extern int y; template static int y; template<> static int y; // expected-warning {{explicit specialization cannot have a storage class}} template void f(); template<> static void f(); // expected-warning {{explicit specialization cannot have a storage class}} template extern void g(); template<> static void g(); // expected-warning {{explicit specialization cannot have a storage class}} struct A { static int x; static int y; static void f(); static void g(); }; int A::x = 0; static int A::y = 0; // expected-error {{'static' can only be specified inside the class definition}} void A::f() { } static void A::g() { } // expected-error {{'static' can only be specified inside the class definition}} struct B { template static int x; template static int y; template int z; // expected-error {{non-static data member 'z' cannot be declared as a template}} template static int x; template static int y; template int x; // expected-error {{non-static data member 'x' cannot be declared as a template}} template<> int x; template<> static int x; // expected-warning {{explicit specialization cannot have a storage class}} template static void f(); template static void g(); template<> void f(); template<> static void f(); // expected-warning {{explicit specialization cannot have a storage class}} }; template int B::x = 0; template static int B::y = 0; // expected-error {{'static' can only be specified inside the class definition}} template int B::x = 0; template static int B::y = 0; // expected-error {{'static' can only be specified inside the class definition}} template int B::x; template static int B::y; // expected-error {{'static' can only be specified inside the class definition}} template<> int B::x; template<> static int B::y; // expected-warning {{explicit specialization cannot have a storage class}} // expected-error@-1 {{'static' can only be specified inside the class definition}} template void B::f() { } template static void B::g() { } // expected-error {{'static' can only be specified inside the class definition}} template<> void B::f(); template<> static void B::g(); // expected-warning {{explicit specialization cannot have a storage class}} // expected-error@-1 {{'static' can only be specified inside the class definition}} template struct C { static int x; static int y; static void f(); static void g(); }; template int C::x = 0; template static int C::y = 0; // expected-error {{'static' can only be specified inside the class definition}} template void C::f() { } template static void C::g() { } // expected-warning {{'static' can only be specified inside the class definition}} template<> int C::x = 0; template<> static int C::y = 0; // expected-warning {{explicit specialization cannot have a storage class}} // expected-error@-1 {{'static' can only be specified inside the class definition}} template<> void C::f(); template<> static void C::g(); // expected-warning {{explicit specialization cannot have a storage class}} // expected-error@-1 {{'static' can only be specified inside the class definition}} template struct D { template static int x; template static int y; template int z; // expected-error {{non-static data member 'z' cannot be declared as a template}} template static int x; template static int y; template int x; // expected-error {{non-static data member 'x' cannot be declared as a template}} template<> int x; template<> static int x; // expected-warning {{explicit specialization cannot have a storage class}} template static void f(); template static void g(); template<> void f(); template<> static void f(); // expected-warning {{explicit specialization cannot have a storage class}} }; template template int D::x = 0; template template static int D::y = 0; // expected-error {{'static' can only be specified inside the class definition}} template template int D::x = 0; template template static int D::y = 0; // expected-error {{'static' can only be specified inside the class definition}} template template int D::x; template template static int D::y; // expected-error {{'static' can only be specified inside the class definition}} template<> template int D::x; template<> template static int D::y; // expected-warning {{explicit specialization cannot have a storage class}} // expected-error@-1 {{'static' can only be specified inside the class definition}} template<> template int D::x; template<> template static int D::y; // expected-warning {{explicit specialization cannot have a storage class}} // expected-error@-1 {{'static' can only be specified inside the class definition}} template<> template<> int D::x; template<> template<> static int D::y; // expected-warning {{explicit specialization cannot have a storage class}} // expected-error@-1 {{'static' can only be specified inside the class definition}} template template void D::f() { } template template static void D::g() { } // expected-warning {{'static' can only be specified inside the class definition}} template<> template void D::f(); template<> template static void D::g(); // expected-warning {{explicit specialization cannot have a storage class}} // expected-error@-1 {{'static' can only be specified inside the class definition}} template<> template<> void D::f(); template<> template<> static void D::g(); // expected-warning {{explicit specialization cannot have a storage class}} // expected-error@-1 {{'static' can only be specified inside the class definition}}