cxxheaderparser icon indicating copy to clipboard operation
cxxheaderparser copied to clipboard

[PARSE BUG]: fails to parse "non-pointer" function argument

Open sampotter opened this issue 10 months ago • 1 comments

Problem description

I was very sad to learn that this is valid C++:

void RemoveIf(bool predicate(const T& key));

but apparently it is. 🙃

This library fails to parse it. Changing the line to:

void RemoveIf(bool (*predicate)(const T& key));

fixes the problem, although they are functionally equivalent.

C++ code that can't be parsed correctly (please double-check that https://robotpy.github.io/cxxheaderparser/ has the same error)

void RemoveIf(bool (*predicate)(const T& key));

sampotter avatar Apr 24 '25 16:04 sampotter

C++ is awful.

virtuald avatar Apr 24 '25 17:04 virtuald