summaryrefslogtreecommitdiff
path: root/test/SemaTemplate/temp_explicit.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-12 23:25:50 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-12 23:25:50 +0000
commit4d9a16f36d3b768672d50e6d02000f982ae448d7 (patch)
treed25cf10b1f7bd1f93a5559c45ac95dc915781d70 /test/SemaTemplate/temp_explicit.cpp
parent05fa629c9f61ae62bef5315344c840fe3d239328 (diff)
downloadclang-4d9a16f36d3b768672d50e6d02000f982ae448d7.tar.gz
Implement parsing for explicit instantiations of class templates, e.g.,
template class X<int>; This also cleans up the propagation of template information through declaration parsing, which is used to improve some diagnostics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71608 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/temp_explicit.cpp')
-rw-r--r--test/SemaTemplate/temp_explicit.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/SemaTemplate/temp_explicit.cpp b/test/SemaTemplate/temp_explicit.cpp
new file mode 100644
index 0000000000..884fc38167
--- /dev/null
+++ b/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}}