Skip to content

Commit db37b4c

Browse files
committed
[PreCheck] Remove PreCheckExpression::isPostfixEllipsisOperator.
1 parent 287b54f commit db37b4c

File tree

1 file changed

+1
-27
lines changed

1 file changed

+1
-27
lines changed

lib/Sema/PreCheckExpr.cpp

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -991,10 +991,6 @@ namespace {
991991
/// in simple pattern-like expressions, so we reject anything complex here.
992992
void markAcceptableDiscardExprs(Expr *E);
993993

994-
/// Check if this is a postfix '...' operator, which might denote a pack
995-
/// expansion expression.
996-
Expr *isPostfixEllipsisOperator(Expr *E);
997-
998994
public:
999995
PreCheckExpression(DeclContext *dc, Expr *parent,
1000996
bool replaceInvalidRefsWithErrors,
@@ -1468,7 +1464,7 @@ bool PreCheckExpression::exprLooksLikeAType(Expr *expr) {
14681464
isa<ForceValueExpr>(expr) ||
14691465
isa<ParenExpr>(expr) ||
14701466
isa<ArrowExpr>(expr) ||
1471-
isPostfixEllipsisOperator(expr) ||
1467+
isa<PackExpansionExpr>(expr) ||
14721468
isa<TupleExpr>(expr) ||
14731469
(isa<ArrayExpr>(expr) &&
14741470
cast<ArrayExpr>(expr)->getElements().size() == 1) ||
@@ -1667,28 +1663,6 @@ VarDecl *PreCheckExpression::getImplicitSelfDeclForSuperContext(SourceLoc Loc) {
16671663
return methodSelf;
16681664
}
16691665

1670-
/// Check if this is a postfix '...' operator, which might denote a pack
1671-
/// expansion expression.
1672-
Expr *PreCheckExpression::isPostfixEllipsisOperator(Expr *E) {
1673-
if (!Ctx.LangOpts.hasFeature(Feature::VariadicGenerics))
1674-
return nullptr;
1675-
1676-
auto *postfixExpr = dyn_cast<PostfixUnaryExpr>(E);
1677-
if (!postfixExpr)
1678-
return nullptr;
1679-
1680-
if (auto *op = dyn_cast<OverloadedDeclRefExpr>(postfixExpr->getFn())) {
1681-
if (op->getDecls()[0]->getBaseName().getIdentifier().isExpansionOperator()) {
1682-
return postfixExpr->getOperand();
1683-
}
1684-
} else if (auto *op = dyn_cast<UnresolvedDeclRefExpr>(postfixExpr->getFn())) {
1685-
if (op->getName().getBaseName().getIdentifier().isExpansionOperator())
1686-
return postfixExpr->getOperand();
1687-
}
1688-
1689-
return nullptr;
1690-
}
1691-
16921666
/// Simplify expressions which are type sugar productions that got parsed
16931667
/// as expressions due to the parser not knowing which identifiers are
16941668
/// type names.

0 commit comments

Comments
 (0)