================
@@ -255,6 +255,44 @@ TEST_F(FormatTestMacroExpansion,
                          Style);
 }
 
+TEST_F(FormatTestMacroExpansion, CommaAsOperator) {
+  FormatStyle Style = getGoogleStyle();
+  Style.Macros.push_back("ASSIGN_OR_RETURN(a, b, c)=a=(b); if(x) c");
+  verifyFormat(R"(ASSIGN_OR_RETURN(auto reader,
+                 logs::proxy::Reader::NewReader(log_filename, access_options,
+                                                reader_options),
+                 _ << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa << aaaaaa << aaaaaaaaa
+                   << aaaaaaaaaaaa << aaaaaaaaaaa << aaaaaaaaaaaa);
+)", Style);
+}
+
+TEST_F(FormatTestMacroExpansion, ForcedBreakDiffers) {
+  FormatStyle Style = getGoogleStyle();
+  Style.Macros.push_back("ASSIGN_OR_RETURN(a, b)=a=(b)");
+  EXPECT_EQ(R"(
----------------
owenca wrote:

Can you use the 1-argument version of `verifyFormat()` instead?

https://github.com/llvm/llvm-project/pull/76245
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to