cxxheaderparser icon indicating copy to clipboard operation
cxxheaderparser copied to clipboard

[PARSE BUG]: Cannot parse free conversion operator

Open ostr00000 opened this issue 2 years ago • 0 comments

Problem description

I think the code is correct and should be parsed by cxxheaderparser. But running this code fail with error: :8: parse error evaluating 'operator': unexpected 'operator', expected 'NAME'


Looking at test for operators, it seems that there are tests for conversion_operators and free_operator, but there are no tests for free_conversion_operators, so this probably has never been implemented.

I can implement this and make PR.

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

class Bar{};

class Foo{
    public:
    operator Bar();
};

Foo::operator Bar() { return Bar(); }

ostr00000 avatar Jan 12 '24 00:01 ostr00000