Skip to content

C++: Inherited virtual functions duplicated when using Base::func #10588

@ZedThree

Description

@ZedThree

Describe the bug

If a derived class has a using declaration to bring in overloads of a virtual function, the overridden functions from the base class still appear in the output. Here's a minimal example:

struct Base {
  /// Zero arg impl
  virtual int foo() { return 42; };
  /// One arg impl
  virtual int foo(int x) { return x; };
};

struct Derived : public Base {
  using Base::foo;
  /// One arg override
  int foo(int x) override { return x + 1; }
};

(source + doxyfile: mvce.tar.gz)

which generates:

image

I would expect the virtual int (int x) function to not appear here, because the override hides it.

Version

This happens with 1.10.0 on openSUSE Tumbleweed 20240103, but I also compiled 1.8.20 and 1.9.0 from source and found the same issue. I couldn't easily compile older versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions