FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.pt / explicit70.C
blob544faf7bdb2368b83b43cf8b9872e5327b432766
1 // Build don't link:
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); // ERROR - duplicate explicit instantiation 
16 template int S<int>::t;
17 template int S<int>::t; // ERROR - duplicate explicit instantiation 
18 template class S<double>;
19 template class S<double>; // ERROR - duplicate explicit instantiation 
21 extern template void f(double); // WARNING - extern not allowed
22 inline template class S<float>; // WARNING - 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); // ERROR - no definition of g.