[PATCH] D12362: [clang-format] Add support of consecutive declarations alignment

Beren Minor via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 29 09:09:50 PDT 2015


berenm added inline comments.

================
Comment at: unittests/Format/FormatTest.cpp:8699
@@ +8698,3 @@
+                   Alignment));
+  Alignment.AlignConsecutiveAssignments = true;
+  verifyFormat("float      something = 2000;\n"
----------------
djasper wrote:
> Can you add a case (unless I missed it) where aligning both consecutive assignments and consecutive declarations exceed the column limit? What should happen in that case? I am thinking of something like:
> 
>   int loooooooooooooooongName = 1;
>   LoooooooooooongType i = bbbbbbbbbbbbbbbbbbbbbbb;
AFAIR, the alignment doesn't work very well with the column limit at the moment. This is already true wrt the assignment alignment. The column limit is enforced before the alignment is done and aligning variable names and / or assignment will expand beyond that limit.

I will add the test case but I haven't tried to fix this issue yet.

Should test cases check the current behaviour or the ideal expected behaviour (that doesn't work) ?


http://reviews.llvm.org/D12362





More information about the cfe-commits mailing list