diff options
author | Manuel Klimek <klimek@google.com> | 2016-01-11 11:39:00 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2016-01-11 11:39:00 +0000 |
commit | 4c67fa747b157a846a884e97a93cdab5a0b37da3 (patch) | |
tree | 0ac3728a968c3c3a32f92e86695f890b94b1a5e1 /clang/test/SemaTemplate/temp_arg_template.cpp | |
parent | 06ca0fc69d9dc91e8ce0cfaf68871f2995c13b8c (diff) | |
download | bcm5719-llvm-4c67fa747b157a846a884e97a93cdab5a0b37da3.tar.gz bcm5719-llvm-4c67fa747b157a846a884e97a93cdab5a0b37da3.zip |
Fix assert hit when tree-transforming template template parameter packs.
Covers significantly more code in the template template pack argument
test and fixes the resulting assert problem.
Differential Revision: http://reviews.llvm.org/D15743
llvm-svn: 257326
Diffstat (limited to 'clang/test/SemaTemplate/temp_arg_template.cpp')
-rw-r--r-- | clang/test/SemaTemplate/temp_arg_template.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/test/SemaTemplate/temp_arg_template.cpp b/clang/test/SemaTemplate/temp_arg_template.cpp index 4a0ed05d879..6d93f1504a4 100644 --- a/clang/test/SemaTemplate/temp_arg_template.cpp +++ b/clang/test/SemaTemplate/temp_arg_template.cpp @@ -75,7 +75,11 @@ template <template <typename> class... Templates> // expected-warning@-2 {{variadic templates are a C++11 extension}} #endif -struct template_tuple {}; +struct template_tuple { +#if __cplusplus >= 201103L + static constexpr int N = sizeof...(Templates); +#endif +}; template <typename T> struct identity {}; template <template <typename> class... Templates> @@ -85,6 +89,12 @@ template <template <typename> class... Templates> template_tuple<Templates...> f7() {} +#if __cplusplus >= 201103L +struct S : public template_tuple<identity, identity> { + static_assert(N == 2, "Number of template arguments incorrect"); +}; +#endif + void foo() { f7<identity>(); } |