|
@@ -2912,9 +2912,11 @@ bool TreeTransform<Derived>::TransformExprs(Expr **Inputs,
|
|
if (Out.isInvalid())
|
|
if (Out.isInvalid())
|
|
return true;
|
|
return true;
|
|
|
|
|
|
|
|
+ // FIXME: Can this happen? We should not try to expand the pack
|
|
|
|
+ // in this case.
|
|
if (Out.get()->containsUnexpandedParameterPack()) {
|
|
if (Out.get()->containsUnexpandedParameterPack()) {
|
|
- Out = RebuildPackExpansion(Out.get(), Expansion->getEllipsisLoc(),
|
|
|
|
- OrigNumExpansions);
|
|
|
|
|
|
+ Out = getDerived().RebuildPackExpansion(
|
|
|
|
+ Out.get(), Expansion->getEllipsisLoc(), OrigNumExpansions);
|
|
if (Out.isInvalid())
|
|
if (Out.isInvalid())
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
@@ -2922,6 +2924,23 @@ bool TreeTransform<Derived>::TransformExprs(Expr **Inputs,
|
|
Outputs.push_back(Out.get());
|
|
Outputs.push_back(Out.get());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // If we're supposed to retain a pack expansion, do so by temporarily
|
|
|
|
+ // forgetting the partially-substituted parameter pack.
|
|
|
|
+ if (RetainExpansion) {
|
|
|
|
+ ForgetPartiallySubstitutedPackRAII Forget(getDerived());
|
|
|
|
+
|
|
|
|
+ ExprResult Out = getDerived().TransformExpr(Pattern);
|
|
|
|
+ if (Out.isInvalid())
|
|
|
|
+ return true;
|
|
|
|
+
|
|
|
|
+ Out = getDerived().RebuildPackExpansion(
|
|
|
|
+ Out.get(), Expansion->getEllipsisLoc(), OrigNumExpansions);
|
|
|
|
+ if (Out.isInvalid())
|
|
|
|
+ return true;
|
|
|
|
+
|
|
|
|
+ Outputs.push_back(Out.get());
|
|
|
|
+ }
|
|
|
|
+
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -8618,6 +8637,9 @@ TreeTransform<Derived>::TransformLambdaScope(LambdaExpr *E,
|
|
// Capture the transformed variable.
|
|
// Capture the transformed variable.
|
|
getSema().tryCaptureVariable(CapturedVar, C->getLocation(), Kind);
|
|
getSema().tryCaptureVariable(CapturedVar, C->getLocation(), Kind);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // FIXME: Retain a pack expansion if RetainExpansion is true.
|
|
|
|
+
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -9122,6 +9144,7 @@ TreeTransform<Derived>::TransformObjCDictionaryLiteral(
|
|
|
|
|
|
// If any unexpanded parameter packs remain, we still have a
|
|
// If any unexpanded parameter packs remain, we still have a
|
|
// pack expansion.
|
|
// pack expansion.
|
|
|
|
+ // FIXME: Can this really happen?
|
|
if (Key.get()->containsUnexpandedParameterPack() ||
|
|
if (Key.get()->containsUnexpandedParameterPack() ||
|
|
Value.get()->containsUnexpandedParameterPack())
|
|
Value.get()->containsUnexpandedParameterPack())
|
|
Element.EllipsisLoc = OrigElement.EllipsisLoc;
|
|
Element.EllipsisLoc = OrigElement.EllipsisLoc;
|
|
@@ -9129,6 +9152,8 @@ TreeTransform<Derived>::TransformObjCDictionaryLiteral(
|
|
Elements.push_back(Element);
|
|
Elements.push_back(Element);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // FIXME: Retain a pack expansion if RetainExpansion is true.
|
|
|
|
+
|
|
// We've finished with this pack expansion.
|
|
// We've finished with this pack expansion.
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|