// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s template void f0(T); // expected-note{{here}} template void f0(int); // expected-error{{explicit instantiation of undefined function template}} template struct X0 { struct Inner; void f1(); // expected-note{{here}} static T value; // expected-note{{here}} }; template void X0::f1(); // expected-error{{explicit instantiation of undefined member function}} template int X0::value; // expected-error{{explicit instantiation of undefined static data member}} template<> void f0(long); // expected-note{{previous template specialization is here}} template void f0(long); // expected-warning{{explicit instantiation of 'f0' that occurs after an explicit specialization has no effect}} template<> void X0::f1(); // expected-note{{previous template specialization is here}} template void X0::f1(); // expected-warning{{explicit instantiation of 'f1' that occurs after an explicit specialization has no effect}} template<> struct X0::Inner; // expected-note{{previous template specialization is here}} template struct X0::Inner; // expected-warning{{explicit instantiation of 'Inner' that occurs after an explicit specialization has no effect}} template<> long X0::value; // expected-note{{previous template specialization is here}} template long X0::value; // expected-warning{{explicit instantiation of 'value' that occurs after an explicit specialization has no effect}} template<> struct X0; // expected-note{{previous template specialization is here}} template struct X0; // expected-warning{{explicit instantiation of 'X0' that occurs after an explicit specialization has no effect}} // PR 6458 namespace test0 { template class foo { int compare(T x, T y); }; template <> int foo::compare(char x, char y); template int foo::compare(T x, T y) { // invalid at T=char; if we get a diagnostic here, we're // inappropriately instantiating this template. void *ptr = x; } extern template class foo; // expected-warning 0-1{{extern templates are a C++11 extension}} template class foo; }