diff options
author | mydeveloperday <mydeveloperday@gmail.com> | 2021-05-15 11:29:56 +0100 |
---|---|---|
committer | mydeveloperday <mydeveloperday@gmail.com> | 2021-05-15 11:29:56 +0100 |
commit | eae445f65d077304703e3290ddb4ff28f6d65ff4 (patch) | |
tree | 546e89e1e39ac7bc65f171fda001d6534fbd9160 /llvm/lib/Transforms/Utils/Local.cpp | |
parent | 6418bab6f8827960b9d161f5c9c2b8f9702c80e0 (diff) | |
download | llvm-eae445f65d077304703e3290ddb4ff28f6d65ff4.zip llvm-eae445f65d077304703e3290ddb4ff28f6d65ff4.tar.gz llvm-eae445f65d077304703e3290ddb4ff28f6d65ff4.tar.bz2 |
[clang-format] PR50326 AlignAfterOpenBracket AlwaysBreak does not keep to the ColumnLimit
https://bugs.llvm.org/show_bug.cgi?id=50326
{D93626} caused a regression in terms of formatting a function ptr, incorrectly thinking it was a C-Style cast.
This cased a formatter regression between clang-format-11 and clang-format-12
```
void bar()
{
size_t foo = function(Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong);
size_t foo = function(
Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong, BarrrrrrrrrrrrLong,
FoooooooooLooooong);
size_t foo = (*(function))(Foooo, Barrrrr, Foooo, FoooooooooLooooong);
size_t foo = (*(
function))(Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong,
BarrrrrrrrrrrrLong, FoooooooooLooooong);
}
```
became
```
void bar()
{
size_t foo1 = function(Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong);
size_t foo2 = function(
Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong, BarrrrrrrrrrrrLong,
FoooooooooLooooong);
size_t foo3 = (*(function))(Foooo, Barrrrr, Foooo, FoooooooooLooooong);
size_t foo4 = (*(
function))(Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong, BarrrrrrrrrrrrLong, FoooooooooLooooong);
}
```
This fixes this issue by simplify the clause to be specific about what is wanted rather than what is not.
Reviewed By: curdeius, HazardyKnusperkeks
Differential Revision: https://reviews.llvm.org/D102392
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
0 files changed, 0 insertions, 0 deletions