Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CXX / temp / temp.spec / temp.expl.spec / p16.cpp
blobc7597e9f817cac0a345019fc31285e590cc48451
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 template<class T> struct A {
3 void f(T);
4 template<class X1> void g1(T, X1);
5 template<class X2> void g2(T, X2);
6 void h(T) { }
7 };
9 // specialization
10 template<> void A<int>::f(int);
12 // out of class member template definition
13 template<class T> template<class X1> void A<T>::g1(T, X1) { }
15 // member template specialization
16 template<> template<class X1> void A<int>::g1(int, X1);
18 // member template specialization
19 template<> template<>
20 void A<int>::g1(int, char); // X1 deduced as char
22 template<> template<>
23 void A<int>::g2<char>(int, char); // X2 specified as char
24 // member specialization even if defined in class definition
26 template<> void A<int>::h(int) { }
28 namespace PR10024 {
29 template <typename T>
30 struct Test{
31 template <typename U>
32 void get(U i) {}
33 };
35 template <typename T>
36 template <>
37 void Test<T>::get<double>(double i) {} // expected-error{{cannot specialize (with 'template<>') a member of an unspecialized template}}