diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-05-12 23:25:50 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-05-12 23:25:50 +0000 |
commit | 1b57ff32a828c485f5b685ffe02e2effa79f405a (patch) | |
tree | 79d0cd3dbd5bff8a94b409d94fd36b947fb3b6e3 /clang/test/SemaTemplate/temp_explicit.cpp | |
parent | e83b560e0687b83a118ee352a93bc10014153248 (diff) | |
download | bcm5719-llvm-1b57ff32a828c485f5b685ffe02e2effa79f405a.tar.gz bcm5719-llvm-1b57ff32a828c485f5b685ffe02e2effa79f405a.zip |
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.
llvm-svn: 71608
Diffstat (limited to 'clang/test/SemaTemplate/temp_explicit.cpp')
-rw-r--r-- | clang/test/SemaTemplate/temp_explicit.cpp | 19 |
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}} |