1 // RUN: %clang_cc1 -fsyntax-only -verify=expected,spec %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-explicit-specialization-storage-class %s
4 // A storage-class-specifier shall not be specified in an explicit
5 // specialization (14.7.3) or an explicit instantiation (14.7.2)
7 template<typename T
> void f(T
) {}
8 template<typename T
> static void g(T
) {}
11 template<> static void f
<int>(int); // spec-warning{{explicit specialization cannot have a storage class}}
12 template static void f
<float>(float); // expected-error{{explicit instantiation cannot have a storage class}}
14 template<> void f
<double>(double);
15 template void f
<long>(long);
17 template<> static void g
<int>(int); // spec-warning{{explicit specialization cannot have a storage class}}
18 template static void g
<float>(float); // expected-error{{explicit instantiation cannot have a storage class}}
20 template<> void g
<double>(double);
21 template void g
<long>(long);
31 template static int X
<int>::value
; // expected-error{{explicit instantiation cannot have a storage class}}
33 template<> static int X
<float>::value
; // spec-warning{{explicit specialization cannot have a storage class}}
34 // expected-error@-1{{'static' can only be specified inside the class definition}}
40 static void f1
<int>(); // spec-warning{{explicit specialization cannot have a storage class}}