[clang] [clang-format] Configure ASSIGN_OR_RETURN et al. macros for Google style (PR #200210)

Jesse Rosenstock via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 4 04:05:37 PST 2026


================
@@ -58,10 +58,18 @@ TEST_F(FormatTestMacroExpansion, UnexpandConfiguredMacros) {
   verifyFormat("ASSIGN_OR_RETURN(MySomewhatLongType *variable,\n"
                "                 MySomewhatLongFunction(SomethingElse()));",
                Style);
-  verifyFormat("ASSIGN_OR_RETURN(MySomewhatLongType *variable,\n"
-               "                 MySomewhatLongFunction(SomethingElse()), "
-               "ReturnMe());",
-               Style);
+  verifyFormat(
+      "ASSIGN_OR_RETURN(MySomewhatLongType *variable,\n"
+      "                 MySomewhatLongFunction(SomethingElse()), RetMe());",
+      Style);
+
+  verifyFormat(
+      "void f() {\n"
+      "  ASSIGN_OR_RETURN(MySomewhatLongType* variable,\n"
+      "                   MySomewhatLongFunction(SomethingElse()));\n"
+      "  ASSIGN_OR_RETURN(MySomewhatLongType* variable,\n"
----------------
jmr wrote:

Yes. Since `GoogleMacrosFormatsAsPtrDecl` now covers this, I removed it.

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


More information about the cfe-commits mailing list