Skip to content

[PARSE BUG]: Cannot parse free conversion operator  #94

Open
@ostr00000

Description

@ostr00000

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(); }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions