[clang] [Format] Configure ASSIGN_OR_RETURN macros for Google style (PR #169037)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 24 23:22:46 PST 2025
================
@@ -1961,6 +1961,10 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) {
GoogleStyle.PenaltyBreakBeforeFirstCallParameter = 1;
GoogleStyle.PenaltyReturnTypeOnItsOwnLine = 200;
+ GoogleStyle.Macros.push_back("ASSIGN_OR_RETURN(a, b)=a = (b)");
+ GoogleStyle.Macros.push_back(
+ "ASSIGN_OR_RETURN(a, b, c)=a = (b); if (x) return c");
+
----------------
mydeveloperday wrote:
shouldn't this just be GoogleStyle.Macros.push_back("ASSIGN_OR_RETURN")?
https://github.com/llvm/llvm-project/pull/169037
More information about the cfe-commits
mailing list