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