Skip to content

A derived class lists the inheriting constructors of its base as its own #1358

Open

Description

@gennaroprota

using Base::Base; makes the constructors of Base constructors of the class that writes it, and constructors aren't inherited any further. Yet a class that derives from that class lists the using-declaration as one of its own members:

struct Base { Base(int); };
struct Mid : Base { using Base::Base; };
struct Derived : Mid {};

The page of Derived has a "Using Declarations" table with Base in it, linking to the declaration in Mid, although Derived can't be constructed from an int.

Why it happens

When it copies the members of a base into a derived class, src/mrdocs/Metadata/Finalizers/BaseMembersFinalizer.cpp skips constructors and destructors, but not a using-declaration that inherits constructors. It should skip that too. #1317 adds isInheritingConstructor to src/mrdocs/Corpus.cpp to recognize such a declaration, and it could be moved where both places can use it.

The copying predates #1317, which only makes the entry read Base instead of the name of the derived class.

Activity

  1. added
    fixSomething that is broken / incorrect behavior
    on Oct 14, 2026
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

    fixSomething that is broken / incorrect behavior

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions