[PATCH] D121069: [clang-format] Minimize the damage caused by AlignArrayOfStructures when working on non square arrays

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 6 07:42:25 PST 2022


MyDeveloperDay added a comment.

NOTE: I've tried to collate all the reported crashing examples and run this fix through them (both Left and Right) all pass except this one below



  void foo()
  {
  auto thing = test{
      {
         {something}, //A
      }
    };
  }

This is not related to it being non-square because it's not.



================
Comment at: clang/unittests/Format/FormatTest.cpp:25309
+
+  // TODO don't adjust this non square array
+  verifyFormat("struct test demo[] = {\n"
----------------
curdeius wrote:
> Not sure I understand the comment here, this formatting looks ok, no?
The test is testing that it's not changing it.. with the old code it would (but incorrectly or crash)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121069/new/

https://reviews.llvm.org/D121069



More information about the cfe-commits mailing list