https://bugs.llvm.org/show_bug.cgi?id=50326
D93626: [clang-format] PR48535 clang-format Incorrectly Removes Space After C Style Cast When Type Is Not a Pointer 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.