Skip to content

Commit e80ee92

Browse files
committed
[PreCheckExpr] Gate PackExpansionExpr creation behind the variadic generics flag.
1 parent 032c511 commit e80ee92

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/Sema/CSDiagnostics.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7059,6 +7059,7 @@ bool ExtraneousCallFailure::diagnoseAsError() {
70597059
}
70607060
}
70617061

7062+
anchor.dump();
70627063
auto diagnostic =
70637064
emitDiagnostic(diag::cannot_call_non_function_value, getType(anchor));
70647065
removeParensFixIt(diagnostic);

lib/Sema/PreCheckExpr.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,8 @@ namespace {
13781378
// references to PackExpansionExpr.
13791379
if (auto *postfixExpr = dyn_cast<PostfixUnaryExpr>(expr)) {
13801380
auto *op = dyn_cast<OverloadedDeclRefExpr>(postfixExpr->getFn());
1381-
if (op && op->getDecls()[0]->getBaseName().getIdentifier().isExpansionOperator()) {
1381+
if (op && Ctx.LangOpts.hasFeature(Feature::VariadicGenerics) &&
1382+
op->getDecls()[0]->getBaseName().getIdentifier().isExpansionOperator()) {
13821383
auto *operand = postfixExpr->getOperand();
13831384
if (auto *expansion = getPackExpansion(DC, operand, op->getLoc())) {
13841385
return Action::Continue(expansion);

0 commit comments

Comments
 (0)