diff options
author | ed <ed@FreeBSD.org> | 2009-06-14 09:24:02 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-06-14 09:24:02 +0000 |
commit | b8e7410b22fa573fb0078712439f343bc69208dd (patch) | |
tree | d472a7615b5c7e413aa62a77d0777c1a9cf76478 /test/SemaTemplate/variadic-class-template-2.cpp | |
parent | 6514d87c1aa5b544d02c3822fe41217e2051673d (diff) | |
download | FreeBSD-src-b8e7410b22fa573fb0078712439f343bc69208dd.zip FreeBSD-src-b8e7410b22fa573fb0078712439f343bc69208dd.tar.gz |
Import Clang r73340.
Diffstat (limited to 'test/SemaTemplate/variadic-class-template-2.cpp')
-rw-r--r-- | test/SemaTemplate/variadic-class-template-2.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/SemaTemplate/variadic-class-template-2.cpp b/test/SemaTemplate/variadic-class-template-2.cpp new file mode 100644 index 0000000..eadea90 --- /dev/null +++ b/test/SemaTemplate/variadic-class-template-2.cpp @@ -0,0 +1,19 @@ +// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x + +// Type parameters packs +template <typename ...> struct TS1 {}; // expected-note{{template parameter is declared here}} +template struct TS1<>; +template struct TS1<int>; +template struct TS1<int, int>; +template struct TS1<int, 10>; // expected-error{{template argument for template type parameter must be a type}} + +template <typename, typename ...> struct TS2 {}; // expected-note{{template is declared here}} +template struct TS2<>; // expected-error{{too few template arguments for class template 'TS2'}} +template struct TS2<int>; +template struct TS2<int, int>; + +template <typename = int, typename ...> struct TS3 {}; // expected-note{{template parameter is declared here}} +template struct TS3<>; // expected-note{{previous explicit instantiation is here}} +template struct TS3<int>; // expected-error{{duplicate explicit instantiation of 'TS3<>'}} +template struct TS3<int, int>; +template struct TS3<10>; // expected-error{{template argument for template type parameter must be a type}} |