1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s
10 static int x
<int>; // expected-warning {{explicit specialization cannot have a storage class}}
19 static int y
<int>; // expected-warning {{explicit specialization cannot have a storage class}}
25 static void f
<int>(); // expected-warning {{explicit specialization cannot have a storage class}}
31 static void g
<int>(); // expected-warning {{explicit specialization cannot have a storage class}}
45 static int A::y
= 0; // expected-error {{'static' can only be specified inside the class definition}}
49 static void A::g() { } // expected-error {{'static' can only be specified inside the class definition}}
59 int z
; // expected-error {{non-static data member 'z' cannot be declared as a template}}
68 int x
<T
**>; // expected-error {{non-static data member 'x' cannot be declared as a template}}
74 static int x
<long>; // expected-warning {{explicit specialization cannot have a storage class}}
86 static void f
<long>(); // expected-warning {{explicit specialization cannot have a storage class}}
93 static int B::y
= 0; // expected-error {{'static' can only be specified inside the class definition}}
99 static int B::y
<T
*> = 0; // expected-error {{'static' can only be specified inside the class definition}}
105 static int B::y
<T
***>; // expected-error {{'static' can only be specified inside the class definition}}
111 static int B::y
<unsigned>; // expected-warning {{explicit specialization cannot have a storage class}}
112 // expected-error@-1 {{'static' can only be specified inside the class definition}}
118 static void B::g() { } // expected-error {{'static' can only be specified inside the class definition}}
121 void B::f
<unsigned>();
124 static void B::g
<unsigned>(); // expected-warning {{explicit specialization cannot have a storage class}}
125 // expected-error@-1 {{'static' can only be specified inside the class definition}}
142 static int C
<T
>::y
= 0; // expected-error {{'static' can only be specified inside the class definition}}
148 static void C
<T
>::g() { } // expected-warning {{'static' can only be specified inside the class definition}}
154 static int C
<int>::y
= 0; // expected-warning {{explicit specialization cannot have a storage class}}
155 // expected-error@-1 {{'static' can only be specified inside the class definition}}
161 static void C
<int>::g(); // expected-warning {{explicit specialization cannot have a storage class}}
162 // expected-error@-1 {{'static' can only be specified inside the class definition}}
172 int z
; // expected-error {{non-static data member 'z' cannot be declared as a template}}
181 int x
<U
**>; // expected-error {{non-static data member 'x' cannot be declared as a template}}
187 static int x
<long>; // expected-warning {{explicit specialization cannot have a storage class}}
199 static void f
<long>(); // expected-warning {{explicit specialization cannot have a storage class}}
208 static int D
<T
>::y
= 0; // expected-error {{'static' can only be specified inside the class definition}}
216 static int D
<T
>::y
<U
*> = 0; // expected-error {{'static' can only be specified inside the class definition}}
224 static int D
<T
>::y
<U
***>; // expected-error {{'static' can only be specified inside the class definition}}
232 static int D
<int>::y
; // expected-warning {{explicit specialization cannot have a storage class}}
233 // expected-error@-1 {{'static' can only be specified inside the class definition}}
236 int D
<int>::x
<U
****>;
240 static int D
<int>::y
<U
****>; // expected-warning {{explicit specialization cannot have a storage class}}
241 // expected-error@-1 {{'static' can only be specified inside the class definition}}
244 int D
<int>::x
<unsigned>;
248 static int D
<int>::y
<unsigned>; // expected-warning {{explicit specialization cannot have a storage class}}
249 // expected-error@-1 {{'static' can only be specified inside the class definition}}
257 static void D
<T
>::g() { } // expected-warning {{'static' can only be specified inside the class definition}}
265 static void D
<int>::g(); // expected-warning {{explicit specialization cannot have a storage class}}
266 // expected-error@-1 {{'static' can only be specified inside the class definition}}
269 void D
<int>::f
<unsigned>();
273 static void D
<int>::g
<unsigned>(); // expected-warning {{explicit specialization cannot have a storage class}}
274 // expected-error@-1 {{'static' can only be specified inside the class definition}}