forked from OSchip/llvm-project
eae445f65d
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 |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
CleanupTest.cpp | ||
FormatTest.cpp | ||
FormatTestCSharp.cpp | ||
FormatTestComments.cpp | ||
FormatTestJS.cpp | ||
FormatTestJava.cpp | ||
FormatTestObjC.cpp | ||
FormatTestProto.cpp | ||
FormatTestRawStrings.cpp | ||
FormatTestSelective.cpp | ||
FormatTestTableGen.cpp | ||
FormatTestTextProto.cpp | ||
FormatTestUtils.h | ||
MacroExpanderTest.cpp | ||
NamespaceEndCommentsFixerTest.cpp | ||
SortImportsTestJS.cpp | ||
SortImportsTestJava.cpp | ||
SortIncludesTest.cpp | ||
TestLexer.h | ||
TokenAnnotatorTest.cpp | ||
UsingDeclarationsSorterTest.cpp |