summaryrefslogtreecommitdiff
path: root/test/CXX/temp/temp.spec/temp.explicit/p4.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CXX/temp/temp.spec/temp.explicit/p4.cpp')
-rw-r--r--test/CXX/temp/temp.spec/temp.explicit/p4.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/CXX/temp/temp.spec/temp.explicit/p4.cpp b/test/CXX/temp/temp.spec/temp.explicit/p4.cpp
new file mode 100644
index 0000000000000..04e511b0b2d5d
--- /dev/null
+++ b/test/CXX/temp/temp.spec/temp.explicit/p4.cpp
@@ -0,0 +1,32 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+template<typename T> void f0(T); // expected-note{{here}}
+template void f0(int); // expected-error{{explicit instantiation of undefined function template}}
+
+template<typename T>
+struct X0 {
+ struct Inner;
+
+ void f1(); // expected-note{{here}}
+
+ static T value; // expected-note{{here}}
+};
+
+template void X0<int>::f1(); // expected-error{{explicit instantiation of undefined member function}}
+
+template int X0<int>::value; // expected-error{{explicit instantiation of undefined static data member}}
+
+template<> void f0(long);
+template void f0(long); // okay
+
+template<> void X0<long>::f1();
+template void X0<long>::f1();
+
+template<> struct X0<long>::Inner;
+template struct X0<long>::Inner;
+
+template<> long X0<long>::value;
+template long X0<long>::value;
+
+template<> struct X0<double>;
+template struct X0<double>;