Skip to content

Commit 1d48a37

Browse files
committed
[Sema] ReturnStmt must be ImplicitConversionExpr aware
Found while doing an unrelated experiment.
1 parent ca0a622 commit 1d48a37

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/Sema/TypeCheckStmt.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,8 @@ class StmtChecker : public StmtVisitor<StmtChecker, Stmt*> {
471471
tryDiagnoseUnnecessaryCastOverOptionSet(TC.Context, E, ResultTy,
472472
DC->getParentModule());
473473
}
474+
while (auto ICE = dyn_cast<ImplicitConversionExpr>(E))
475+
E = ICE->getSubExpr();
474476
if (auto DRE = dyn_cast<DeclRefExpr>(E))
475477
if (auto FD = dyn_cast<FuncDecl>(DRE->getDecl()))
476478
TC.addEscapingFunctionAsReturnValue(FD, RS);

0 commit comments

Comments
 (0)