[clang] [clang][AST][NFC] Add '[[fallthrough]]' to cases fall through (PR #85921)

Ben Shi via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 20 05:02:01 PDT 2024


https://github.com/benshi001 updated https://github.com/llvm/llvm-project/pull/85921

>From 707adafab92900392ed5aabffa678afe9b4903d7 Mon Sep 17 00:00:00 2001
From: Ben Shi <bennshi at tencent.com>
Date: Wed, 20 Mar 2024 19:36:50 +0800
Subject: [PATCH] [clang][AST][NFC] Add '[[fallthrough]];' to cases fall
 through

---
 clang/lib/CodeGen/CGStmt.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp
index 8898e3f22a7df6..7bec3d227f4cac 100644
--- a/clang/lib/CodeGen/CGStmt.cpp
+++ b/clang/lib/CodeGen/CGStmt.cpp
@@ -160,7 +160,8 @@ void CodeGenFunction::EmitStmt(const Stmt *S, ArrayRef<const Attr *> Attrs) {
   case Stmt::ReturnStmtClass:  EmitReturnStmt(cast<ReturnStmt>(*S));      break;
 
   case Stmt::SwitchStmtClass:  EmitSwitchStmt(cast<SwitchStmt>(*S));      break;
-  case Stmt::GCCAsmStmtClass:  // Intentional fall-through.
+  case Stmt::GCCAsmStmtClass:
+    [[fallthrough]];
   case Stmt::MSAsmStmtClass:   EmitAsmStmt(cast<AsmStmt>(*S));            break;
   case Stmt::CoroutineBodyStmtClass:
     EmitCoroutineBody(cast<CoroutineBodyStmt>(*S));



More information about the cfe-commits mailing list