[clang] [Clang] Fix false-positive fallthrough warning (#230802) (PR #234848)

Adinesh Reddy via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 23 02:53:37 PDT 2026


================
@@ -1373,7 +1381,7 @@ class FallthroughMapper : public DynamicRecursiveASTVisitor {
       //   case X: {} case Y:
       //   case X: ; case Y:
       if (const SwitchCase *SW = dyn_cast_or_null<SwitchCase>(B.getLabel()))
-        if (!isa<SwitchCase>(SW->getSubStmt()))
+        if (!isa<SwitchCase>(stripAttributedStmts(SW->getSubStmt())))
----------------
Adinesh-Reddy wrote:

clang treats {} and ; as empty code blocks,since we already unwrapping the attributed and checking ,we dont need to check at getLastStmt

https://github.com/llvm/llvm-project/pull/234848


More information about the cfe-commits mailing list