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

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 6 15:00:26 PST 2022


owenpan added a comment.

In D121069#3362424 <https://reviews.llvm.org/D121069#3362424>, @MyDeveloperDay wrote:

> 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{
>       {
>          {13},
>          {something}, //A
>       }
>     };
>   }
>
> This is not related to it being non-square because it's not.

I think had a simple fix for this. I will revisit it after you land this patch.



================
Comment at: clang/lib/Format/WhitespaceManager.h:202-203
+
+    // Determine if every row in the the array
+    // has the same number of columns.
+    bool HasEqualRowLengths() const {
----------------
Do they fit in one line?


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

https://reviews.llvm.org/D121069



More information about the cfe-commits mailing list