// { dg-do assemble } template void f(T) {} template struct S { static T t; }; template T S::t; template void f(int); template void f(int); // { dg-error "duplicate explicit instantiation" } template int S::t; template int S::t; // { dg-error "duplicate explicit instantiation" } template class S; template class S; // { dg-error "duplicate explicit instantiation" } extern template void f(double); // { dg-error "extern" "" { target { ! c++11 } } } inline template class S; // { dg-error "inline" } inline not allowed template struct S {}; template class S; // OK - explicit instantiation of partial // specialization template <> struct S {}; template class S; // OK - explicit instantiation after template <> void f(long double) {} template void f(long double); // OK - explicit instantiation after template void g(T); template void g(int); // { dg-error "no definition available" "no def" } // { dg-message "required" "inst" { target *-*-* } 43 }