[clang] [clang-format] Keep compound literals stable in macro bodies (PR #173771)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 28 05:26:18 PST 2025


================
@@ -528,7 +553,16 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) {
           Tok->setBlockKind(BK_Block);
         }
       } else {
-        Tok->setBlockKind(BK_Unknown);
+        // In macro bodies we try to keep compound literal expressions like
----------------
HazardyKnusperkeks wrote:

Which path does it take outside of a macro? Can we work on that in a later stage, where `MatchingParen` is already set?

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


More information about the cfe-commits mailing list