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 <int x> struct A {};
template <class T> struct B { };
template <class ...Args> using C = A<(__is_trivially_constructible(Args...))>;
template <class ...Args> using D = C<B<Args>...>;

However, I can't seem to write a test that triggers a visible difference
in behavior.

llvm-svn: 186726
This commit is contained in:
Eli Friedman 2013-07-19 21:49:32 +00:00
parent 8b8a7b5514
commit 5e05c4afe4
1 changed files with 13 additions and 0 deletions

View File

@ -7926,6 +7926,19 @@ TreeTransform<Derived>::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<PackExpansionTypeLoc>(To);
ToExpansionTL.setEllipsisLoc(ExpansionTL.getEllipsisLoc());
}
Args.push_back(TLB.getTypeSourceInfo(SemaRef.Context, To));
}