You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ clang-format --versionclang-format version 15.0.0
$ echo"auto x = { { a, b }, { c, d } }"| clang-format --style="{ Cpp11BracedListStyle: false, AlignArrayOfStructures: Left }"auto x = { {a, b}, { c, d}}
Note the inconsistent spacing before a and c
With Cpp11BracedListStyle: false I'd expect the following, with spaces both before and after the curlies
auto x = {
{ a, b },
{ c, d }
}
The text was updated successfully, but these errors were encountered:
Currently AlignArrayOfStructures=Left is hard coding setting Spaces to
0 for the token following the initial opening brace, but not touching
Spaces for the subsequent lines, which leads to the array being
misaligned. Additionally, it's not adding a space before the trailing
} which is generally done when Cpp11BracedListStyle=false.
I'm not exactly sure why this function needs to override the Spaces as
it seems to generally already be set to either 0 or 1 according to
the other formatting settings, but I'm going with an explicit fix where
I just force the padding to 1 when Cpp11BracedListStyle=false.
AlignArrayOfStructures=Right doesn't have any alignment problems, but
isn't adding the expected padding around the braces either, so I'm
giving that the same treatment.
Fixesllvm#57611.
Differential Revision: https://reviews.llvm.org/D158795
commit-id:e09cfa2b
Note the inconsistent spacing before
a
andc
With
Cpp11BracedListStyle: false
I'd expect the following, with spaces both before and after the curliesauto x = { { a, b }, { c, d } }
The text was updated successfully, but these errors were encountered: