[PATCH] D33532: [coroutines] Fix fallthrough diagnostics for coroutines

Gor Nishanov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 24 18:40:38 PDT 2017


GorNishanov added inline comments.


================
Comment at: lib/Sema/AnalysisBasedWarnings.cpp:378
     const Stmt *S = CS.getStmt();
-    if ((isa<ReturnStmt>(S) && !IsCoroutine) || isa<CoreturnStmt>(S)) {
+    if (isa<ReturnStmt>(S) || isa<CoreturnStmt>(S)) {
       HasLiveReturn = true;
----------------
Is this check no longer needed because of the changes to AnalysisDeclContext.cpp?

At some point it was needed because we were emitting "return gro" to produce the immediate return value from the coroutine, but, we wanted to flag the case when the user forgot to add "co_return"


https://reviews.llvm.org/D33532





More information about the cfe-commits mailing list