[clang] [Format] Configure ASSIGN_OR_RETURN macros for Google style (PR #169037)

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 20 04:33:54 PST 2026


================
@@ -967,6 +967,7 @@ TEST(ConfigParseTest, ParsesConfiguration) {
               std::vector<std::string>({"QUNUSED", "QT_REQUIRE_VERSION"}));
 
   CHECK_PARSE_LIST(JavaImportGroups);
+  Style.Macros.clear();
----------------
ilya-biryukov wrote:

`CHECK_PARSE_LIST(Macros)` would fail otherwise because we'll get the definitions for those `ASSIGN_OR_RETURN` macros added to the parsed file.

This looks intended, `parseConfiguration` takes the default value of the list from the style first and then appends whatever's written in the actual config.
I believe many of the other `.clear()` calls in the file serve the same purpose.

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


More information about the cfe-commits mailing list