Skip to content

Commit 12af066

Browse files
committed
Mark a couple of ReturnStmts implicit
These are both synthesized returns, so they ought to be marked implicit.
1 parent 01402b0 commit 12af066

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/Parse/ParseDecl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -8733,7 +8733,7 @@ Parser::parseAbstractFunctionBodyImpl(AbstractFunctionDecl *AFD) {
87338733
if (F->isFailable() && isa<NilLiteralExpr>(E)) {
87348734
// If it's a nil literal, just insert return. This is the only
87358735
// legal thing to return.
8736-
auto RS = new (Context) ReturnStmt(E->getStartLoc(), E);
8736+
auto RS = new (Context) ReturnStmt(E->getStartLoc(), E, /*implicit*/ true);
87378737
BS->setLastElement(RS);
87388738
AFD->setHasSingleExpressionBody();
87398739
AFD->setSingleExpressionBody(E);

lib/Sema/CodeSynthesis.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1677,7 +1677,7 @@ static std::pair<BraceStmt *, bool>
16771677
synthesizeSingleReturnFunctionBody(AbstractFunctionDecl *afd, void *) {
16781678
ASTContext &ctx = afd->getASTContext();
16791679
SmallVector<ASTNode, 1> stmts;
1680-
stmts.push_back(new (ctx) ReturnStmt(afd->getLoc(), nullptr));
1680+
stmts.push_back(new (ctx) ReturnStmt(afd->getLoc(), nullptr, /*implicit*/ true));
16811681
return { BraceStmt::create(ctx, afd->getLoc(), stmts, afd->getLoc(), true),
16821682
/*isTypeChecked=*/true };
16831683
}

0 commit comments

Comments
 (0)