Skip to content

Commit d42755c

Browse files
committed
[PreCheck] Remove PreCheckExpression::isPostfixEllipsisOperator.
1 parent 24c8d84 commit d42755c

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,
@@ -1469,7 +1465,7 @@ bool PreCheckExpression::exprLooksLikeAType(Expr *expr) {
14691465
isa<ForceValueExpr>(expr) ||
14701466
isa<ParenExpr>(expr) ||
14711467
isa<ArrowExpr>(expr) ||
1472-
isPostfixEllipsisOperator(expr) ||
1468+
isa<PackExpansionExpr>(expr) ||
14731469
isa<TupleExpr>(expr) ||
14741470
(isa<ArrayExpr>(expr) &&
14751471
cast<ArrayExpr>(expr)->getElements().size() == 1) ||
@@ -1668,28 +1664,6 @@ VarDecl *PreCheckExpression::getImplicitSelfDeclForSuperContext(SourceLoc Loc) {
16681664
return methodSelf;
16691665
}
16701666

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

0 commit comments

Comments
 (0)