[PATCH] D33491: clang-format: Fix C99 designated initializers corner cases

Francois Ferrand via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 19 05:03:20 PDT 2017

Typz added inline comments.

Comment at: unittests/Format/FormatTest.cpp:1526
+  verifyFormat("const struct A a = {[0] = 1, [1] = 2};");
+  verifyFormat("const struct A a = {[1] = aaaaaaaaa,\n"
+               "                    [2] = bbbbbbbbb,\n"
djasper wrote:
> Typz wrote:
> > don't know why this test does not pass similarly to similar one with designated member access: in this case, clang-format puts each member in column.
> I don't understand what you mean here.
I did not understand why designated member access [line 1516] was wrapped, while this did not happen with designated array access; but since then I have found out, and updated the code to handle designated array accesses similarly.


More information about the cfe-commits mailing list