[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

Gedare Bloom via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 27 07:46:35 PST 2025


================
@@ -22365,6 +22365,19 @@ TEST_F(FormatTest, BreakPenaltyAfterForLoopLParen) {
                Style);
 }
 
+TEST_F(FormatTest, BreakPenaltyBeforeMemberAccess) {
+  FormatStyle Style = getLLVMStyle();
+  Style.ColumnLimit = 8;
+  Style.PenaltyExcessCharacter = 15;
+  verifyFormat("foo->bar\n"
+               "    .b(a);",
+               Style);
+  Style.PenaltyBreakBeforeMemberAccess = 200;
+  verifyFormat("foo->bar.b(\n"
+               "    a);",
----------------
gedare wrote:

I added this. I kept my original test case for coverage of the `->`.

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


More information about the cfe-commits mailing list