[clang] [clang-format][NFC] Annotate control statement r_braces (PR #68621)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 13 04:25:57 PDT 2023


================
@@ -2756,6 +2756,10 @@ FormatToken *UnwrappedLineParser::parseIfThenElse(IfStmtKind *IfKind,
     CompoundStatementIndenter Indenter(this, Style, Line->Level);
     parseBlock(/*MustBeDeclaration=*/false, /*AddLevels=*/1u,
                /*MunchSemi=*/true, KeepIfBraces, &IfBlockKind);
+    if (auto Prev = FormatTok->getPreviousNonComment();
+        Prev && Prev->is(tok::r_brace)) {
+      Prev->setFinalizedType(TT_ControlStatementRBrace);
+    }
----------------
HazardyKnusperkeks wrote:

Done.

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


More information about the cfe-commits mailing list