← 输入框|github.com|刷新
Skip to content

Incorrectly parsing inheritance with multiple template arguments #27

Closed

Description

@rainman110

The following header is not parsed correctly

template <typename Type>
class XYZ : public MyBaseClass<Type, int>
{
    public:
    XYZ();
};

CppHeaderParser detects two base classes ( 1.: MyBaseClass<Type, 2: int>) instead of one templated base class.

Activity

  1. added
    bug
    on Nov 15, 2019
  2. virtuald commented on Nov 15, 2019

    @virtuald
    Member

    That's not terribly surprising, the template support code is really quite terrible! Happy to accept any fixes. It looks like there's a testcase that's pretty close, so it might not be too bad to fix if you're up for it:

    class Raddish_SetIterator : public Raddish_Iterator<VALUE>

  3. added a commit that references this issue on Nov 15, 2019
  4. virtuald commented on Nov 15, 2019

    @virtuald
    Member

    I've pushed a testcase for this at https://github.com/robotpy/robotpy-cppheaderparser/tree/bug-27, but I don't currently have time to take a further look. It appears the inheritance parsing code just doesn't do templates at all -- which I suspect is probably true elsewhere.

    I'm surprised there isn't a reusable function somewhere that just parses type definitions... but the code is really quite messy, so I shouldn't be surprised. 🤷‍♂️

  5. virtuald commented on Nov 18, 2019

    @virtuald
    Member

    I've got a fix for this ready, just have to fix other bugs.

  6. added 2 commits that reference this issue on Nov 19, 2019
    594e705
    0881438
  7. virtuald commented on Nov 19, 2019

    @virtuald
    Member

    Please give #28 a shot and let me know if that addresses the problem.

  8. rainman110 commented on Nov 19, 2019

    @rainman110
    Author

    Thank you! I'll let you know whether this fixes our problem. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions