================
@@ -696,12 +661,12 @@ static void CheckFallThroughForBody(Sema &S, const Decl 
*D, const Stmt *Body,
   if (CD.checkDiagnostics(Diags, ReturnsVoid, HasNoReturn))
       return;
   SourceLocation LBrace = Body->getBeginLoc(), RBrace = Body->getEndLoc();
-  auto EmitDiag = [&](SourceLocation Loc, unsigned DiagID) {
+  auto EmitDiag = [&](SourceLocation Loc, unsigned DiagID, unsigned FunMode) {
----------------
Sirraide wrote:

Hmm, looking at how this has turned out, I think the entire lambda body can 
just be
```c++
    if (DiagID)
      S.Diag(Loc, DiagID) << CD.FunMode;
```
and then use `EmitDiag` instead of `S.Diag` everywhere in the `switch` 
statement below. That way we don’t have to think too hard about when a diag id 
might or might not be `0`. That also should allow us to remove the 
`IsCoroutine`-related checks again.

https://github.com/llvm/llvm-project/pull/127546
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to