Clang's -Wvexing-parse is enabled by default. When the vexing statement was _intended_ to be interpreted as a function that takes zero arguments, the function's declaration can be rewritten as T foo(void); to silence -Wvexing-parse. This workaround seems to upset clang-tidy.
Given my own lack of understanding of the corners of C++ parsing, I'm... not entirely confident that this patch catches everything && has no unintended side-effects. The bits that -Wvexing-parse depends upon are stored within DeclaratorChunk::FunctionTypeInfos, which seem to only exist during AST formation, so it's not clear to me how to directly get at that information from clang-tidy.
This is not the only way to eliminate the vexing parse warning. For instance, if the intention is to declare foo as a function not in this translation unit, then:
does the trick.
Why assume that the only way to fix vexing-parse is to add (void)?