[X86] Use NSW/NUW flags on ISD::TRUNCATE nodes to improve X86 PACKSS/PACKUS lowering...
[llvm-project.git] / clang / test / CXX / dcl.dcl / dcl.spec / dcl.stc / p1.cpp
blob9efa7b67f5bdbdb43390bf0e3f25e9da1efc038e
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)
6 // directive.
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);
23 template<typename T>
24 struct X {
25 static int value;
28 template<typename T>
29 int X<T>::value = 17;
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}}
36 struct t1 {
37 template<typename>
38 static void f1();
39 template<>
40 static void f1<int>(); // spec-warning{{explicit specialization cannot have a storage class}}