[PATCH] D155342: [clang][JumpDiagnostics] ignore non-asm goto target scopes

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 17 11:59:56 PDT 2023


rjmccall added a comment.

Thanks, that's way better.  Just a couple minor requests.



================
Comment at: clang/docs/ReleaseNotes.rst:629
+- Fixed false positive error diagnostic observed from mixing ``asm goto`` with
+  ``__attribute__((cleanup()))`` variables falsly warning that jumps to
+  non-targets would skip cleanup.
----------------



================
Comment at: clang/lib/Sema/JumpDiagnostics.cpp:361
+      if (!GS->isAsmGoto())
+        break;
     // Remember both what scope a goto is in as well as the fact that we have
----------------
You can pull the `GCCAsmStmtClass` case right above this, make the cast unconditional (`if (!cast<GCCAsmStmt>(S)->isAsmGoto()) break;`), and then fall through into the GotoStmt case.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155342/new/

https://reviews.llvm.org/D155342



More information about the cfe-commits mailing list