From: Eli Friedman Date: Fri, 19 Jul 2013 22:50:29 +0000 (+0000) Subject: Fix pack instantiation with function types. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ba037f2a0cd9bc5614813c3c9293e4e01436e4dd;p=clang Fix pack instantiation with function types. Make sure we correctly expand packs which expand to another pack in a function type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186728 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index 34fdbad87b..4a41b60364 100644 --- a/lib/Sema/TreeTransform.h +++ b/lib/Sema/TreeTransform.h @@ -4269,6 +4269,10 @@ bool TreeTransform:: if (NewType.isNull()) return true; + if (NewType->containsUnexpandedParameterPack()) + NewType = getSema().Context.getPackExpansionType(NewType, + NumExpansions); + OutParamTypes.push_back(NewType); if (PVars) PVars->push_back(0); diff --git a/test/SemaTemplate/alias-templates.cpp b/test/SemaTemplate/alias-templates.cpp index eeb6b95189..f495620b54 100644 --- a/test/SemaTemplate/alias-templates.cpp +++ b/test/SemaTemplate/alias-templates.cpp @@ -189,3 +189,10 @@ namespace PR16646 { } } } + +namespace VariadicAliasWithFunctionType { + template struct A { }; + template using B = A; + template void f(B, A...>) {} + void g() { f(A,A)>()); } +}