[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 10:46:27 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:

Or maybe even add a type for the `&` and the following `(` and `{`? To make it absolutely clear?

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


More information about the cfe-commits mailing list