================
@@ -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:

I can't make out if there are tests like your description where the comment has 
been reflown and then shifted. That should also be mentioned in the option 
description, very clearly, otherwise there will be bug reports.

https://github.com/llvm/llvm-project/pull/190668
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to