explicit-instantiation.cpp [plain text]
template void *;
template typedef void f0;
int v0; template int v0;
template<typename T>
struct X0 {
static T value;
T f0(T x) {
return x + 1; }
T* f0(T*, T*) { return T(); }
template<typename U>
T f0(T, U) { return T(); }
};
template<typename T>
T X0<T>::value;
template int X0<int>::value;
struct NotDefaultConstructible { NotDefaultConstructible(int); };
template NotDefaultConstructible X0<NotDefaultConstructible>::value;
template int X0<int>::f0(int);
template int* X0<int>::f0(int*, int*); template int X0<int>::f0(int, float);
template int X0<int>::f0(int) const; template int* X0<int>::f0(int*, float*);
struct X1 { };
typedef int X1::*MemPtr;
template MemPtr X0<MemPtr>::f0(MemPtr);
struct X2 {
int f0(int);
template<typename T> T f1(T) { return T(); }
template<typename T> T* f1(T*) { return 0; }
template<typename T, typename U> void f2(T, U*) { } template<typename T, typename U> void f2(T*, U) { } };
template int X2::f0(int);
template int *X2::f1(int *);
template void X2::f2(int *, int *);
template<typename T> void print_type() { }
template void print_type<int>();
template void print_type<float>();
template<typename T> void print_type(T*) { }
template void print_type(int*);
template void print_type<int>(float*);
void print_type(double*);
template void print_type<double>(double*);
template<int I> void foo0 (int (&)[I + 1]) { }
template void foo0<2> (int (&)[3]);
namespace explicit_instantiation_after_implicit_instantiation {
template <int I> struct X0 { static int x; };
template <int I> int X0<I>::x;
void test1() { (void)&X0<1>::x; }
template struct X0<1>;
}
template<typename> struct X3 { };
inline template struct X3<int>; static template struct X3<float>;
namespace PR7622 {
template<typename,typename=int>
struct basic_streambuf;
template<typename,typename>
struct basic_streambuf{friend bob<>()}; template struct basic_streambuf<int>;
}
class TC1 {
class TC2 {
template void foo() { }
};
};