[all-commits] [llvm/llvm-project] 617602: [clang-format] Handle generic selections inside pa...
sstwcw via All-commits
all-commits at lists.llvm.org
Mon Feb 5 21:03:14 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 617602d4f23e89e56afd0f550bcf72deb83ed0cb
https://github.com/llvm/llvm-project/commit/617602d4f23e89e56afd0f550bcf72deb83ed0cb
Author: sstwcw <su3e8a96kzlver at posteo.net>
Date: 2024-02-06 (Tue, 06 Feb 2024)
Changed paths:
M clang/lib/Format/ContinuationIndenter.cpp
M clang/unittests/Format/FormatTest.cpp
Log Message:
-----------
[clang-format] Handle generic selections inside parentheses (#79785)
new
```C
while (_Generic(x, //
long: x)(x) > x) {
}
while (_Generic(x, //
long: x)(x)) {
}
```
old
```C
while (_Generic(x, //
long: x)(x) > x) {
}
while (_Generic(x, //
long: x)(x)) {
}
```
In the first case above, the second line previously aligned to the open
parenthesis. The 4 spaces did not get added by the fallback line near
the end of getNewLineColumn because there was already some indentaton.
Now the spaces get added explicitly.
In the second case above, without the fake parentheses, the second line
did not respect the outer parentheses, because the LastSpace field did
not get set without the fake parentheses. Now the indentation of the
outer level is used instead.
More information about the All-commits
mailing list