diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-11-12 01:43:45 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-11-12 01:43:45 +0000 |
commit | d8a52a7831e19eb7a7d9a3be83bbd93078cca6c3 (patch) | |
tree | a46bab50d768fd577750fba17df0876b977d96f1 /clang/test/SemaTemplate/deduction.cpp | |
parent | f44dbda5427bcbdcb7f2c22c57bff8f901ff515a (diff) | |
download | bcm5719-llvm-d8a52a7831e19eb7a7d9a3be83bbd93078cca6c3.tar.gz bcm5719-llvm-d8a52a7831e19eb7a7d9a3be83bbd93078cca6c3.zip |
PR21536: Fix a corner case where we'd get confused by a pack expanding into the
penultimate parameter of a template parameter list, where the last parameter is
itself a pack, and build a bogus empty final pack argument.
llvm-svn: 221748
Diffstat (limited to 'clang/test/SemaTemplate/deduction.cpp')
-rw-r--r-- | clang/test/SemaTemplate/deduction.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/clang/test/SemaTemplate/deduction.cpp b/clang/test/SemaTemplate/deduction.cpp index 59162b74cc6..797f7f8261b 100644 --- a/clang/test/SemaTemplate/deduction.cpp +++ b/clang/test/SemaTemplate/deduction.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11 // Template argument deduction with template template parameters. template<typename T, template<T> class A> @@ -162,3 +162,19 @@ namespace test14 { foo(a); } } + +namespace PR21536 { + template<typename ...T> struct X; + template<typename A, typename ...B> struct S { + static_assert(sizeof...(B) == 1, ""); + void f() { + using T = A; + using T = int; + + using U = X<B...>; + using U = X<int>; + } + }; + template<typename ...T> void f(S<T...>); + void g() { f(S<int, int>()); } +} |