================
@@ -1913,6 +1913,229 @@ TEST_F(AlignmentTest, ConsecutiveDeclarations) {
"void f2(void);\n"
"size_t f3(void);",
Alignment);
+
+ Style = getLLVMStyleWithColumns(47);
+ Style.AlignConsecutiveDeclarations.Enabled = true;
+ verifyFormat("int a = 3; // a long trailing comment\n"
+ "int b = 4; // short comment 1\n"
+ "AReallyLongTypeName c = 5; // short comment 2\n",
+ Style);
+
+ Style.AlignConsecutiveDeclarations.IgnoreTrailingCommentLength = true;
+ verifyFormat("int a = 3; // a long trailing comment\n"
+ "int b = 4; // short comment 1\n"
+ "AReallyLongTypeName c = 5; // short comment 2\n",
+ Style);
+
+ Style = getLLVMStyleWithColumns(120);
----------------
HazardyKnusperkeks wrote:
Does it have to be 120? If yes, please use `// clang-format off` and show the
actual line breaks.
Also I think it would be nice to reduce the test content a bit.
https://github.com/llvm/llvm-project/pull/190668
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits