[clang] 05a77fc - [clang-format] Fall through and avoid an unnecessary check. NFC.

Marek Kurdej via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 16 13:07:20 PST 2022


Author: Marek Kurdej
Date: 2022-02-16T22:07:09+01:00
New Revision: 05a77fc3f97adddc1af3d4fb6d4234047ed09a99

URL: https://github.com/llvm/llvm-project/commit/05a77fc3f97adddc1af3d4fb6d4234047ed09a99
DIFF: https://github.com/llvm/llvm-project/commit/05a77fc3f97adddc1af3d4fb6d4234047ed09a99.diff

LOG: [clang-format] Fall through and avoid an unnecessary check. NFC.

Added: 
    

Modified: 
    clang/lib/Format/TokenAnnotator.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index cb5baae565321..f3885a1f683bc 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -982,10 +982,11 @@ class AnnotatingParser {
         Tok->setType(TT_JsTypeOperator);
       break;
     case tok::kw_if:
-    case tok::kw_while:
-      if (Tok->is(tok::kw_if) && CurrentToken &&
+      if (CurrentToken &&
           CurrentToken->isOneOf(tok::kw_constexpr, tok::identifier))
         next();
+      LLVM_FALLTHROUGH;
+    case tok::kw_while:
       if (CurrentToken && CurrentToken->is(tok::l_paren)) {
         next();
         if (!parseParens(/*LookForDecls=*/true))


        


More information about the cfe-commits mailing list