Daily bump.
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.pt / explicit70.C
blobd744055d9165272b62719cd3cc5aee06a806d80a
1 // { dg-do assemble  }
3 template <class T>
4 void f(T) {}
6 template <class T>
7 struct S {
8   static T t;
9 };
11 template <class T>
12 T S<T>::t;
14 template void f(int);
15 template void f(int); // { dg-error "duplicate explicit instantiation" } 
16 template int S<int>::t;
17 template int S<int>::t; // { dg-error "duplicate explicit instantiation" } 
18 template class S<double>;
19 template class S<double>; // { dg-error "duplicate explicit instantiation" } 
21 extern template void f(double); // { dg-error "extern" "" { target { ! c++11 } } }
22 inline template class S<float>; // { dg-error "inline" } inline not allowed
24 template <class T>
25 struct S<T*> {};
27 template class S<void*>; // OK - explicit instantiation of partial
28                          // specialization
30 template <>
31 struct S<long double> {};
33 template class S<long double>; // OK - explicit instantiation after
35 template <>
36 void f(long double) {}
38 template void f(long double); // OK - explicit instantiation after
40 template <class T>
41 void g(T);
43 template void g(int); // { dg-error "no definition available" "no def" }
44 // { dg-message "required" "inst" { target *-*-* } .-1 }