================
@@ -3007,6 +3007,130 @@ TEST_F(FormatTestComments,
AlignTrailingCommentsAcrossEmptyLines) {
Style);
}
+TEST_F(FormatTestComments, NonTrailingCommentBreaksAlignment) {
+ // Regression test for https://llvm.org/PR208266
+ FormatStyle Style = getGoogleStyle(FormatStyle::LK_Proto);
+ Style.AlignConsecutiveAssignments.Enabled = true;
+ Style.AlignTrailingComments.Kind = FormatStyle::TCAS_Always;
+ Style.AlignTrailingComments.OverEmptyLines = 4;
+ Style.ColumnLimit = 0;
+
+ verifyNoChange("enum E {\n"
+ " A = 0; /* e */\n"
+ "}\n"
+ "/* c */\n"
+ "message M {\n"
+ " int32 a = 1; /* f */\n"
+ " int32 abcd = 2; /* g */\n"
+ "}",
+ Style);
----------------
owenca wrote:
Delete (or reduce if not covered below) as the bug is not specific to
`LK_Proto`, `AlignConsecutiveAssignments`, or `ColumnLimit`.
https://github.com/llvm/llvm-project/pull/208324
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits