summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaTemplate/temp_explicit.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/temp_explicit.cpp b/clang/test/SemaTemplate/temp_explicit.cpp
new file mode 100644
index 00000000000..884fc38167f
--- /dev/null
+++ b/clang/test/SemaTemplate/temp_explicit.cpp
@@ -0,0 +1,19 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+//
+// Tests explicit instantiation of templates.
+template<typename T, typename U = T> class X0 { };
+
+namespace N {
+ template<typename T, typename U = T> class X1 { };
+}
+
+template class X0<int, float>;
+template class X0<int>;
+
+template class N::X1<int>;
+template class ::N::X1<int, float>;
+
+using namespace N;
+template class X1<float>;
+
+template class X0<double> { }; // expected-error{{explicit specialization}}
OpenPOWER on IntegriCloud