From 20cfecac4421223e4f1f6fc825bee9a1275a994a Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Fri, 19 Jul 2013 21:49:32 +0000 Subject: [PATCH] Correctly handle packs for variadic type traits. I'm not sure how to write a test for this; the following shows the difference in -ast-dump: template struct A {}; template struct B { }; template using C = A<(__is_trivially_constructible(Args...))>; template using D = C...>; However, I can't seem to write a test that triggers a visible difference in behavior. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186726 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/TreeTransform.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index ef8049af84..34fdbad87b 100644 --- a/lib/Sema/TreeTransform.h +++ b/lib/Sema/TreeTransform.h @@ -7926,6 +7926,19 @@ TreeTransform::TransformTypeTraitExpr(TypeTraitExpr *E) { if (To.isNull()) return ExprError(); + if (To->containsUnexpandedParameterPack()) { + To = getDerived().RebuildPackExpansionType(To, + PatternTL.getSourceRange(), + ExpansionTL.getEllipsisLoc(), + NumExpansions); + if (To.isNull()) + return ExprError(); + + PackExpansionTypeLoc ToExpansionTL + = TLB.push(To); + ToExpansionTL.setEllipsisLoc(ExpansionTL.getEllipsisLoc()); + } + Args.push_back(TLB.getTypeSourceInfo(SemaRef.Context, To)); } -- 2.40.0