Skip to content

[namespace.udecl] Lack a sufficient rule to specify using-declaration cannot refer to a destructor #5448

Open
@xmh0511

Description

@xmh0511
Contributor

In the current draft, we merely have a note in [namespace.udecl] p4, which says

[Note 2: Since destructors do not have names, a using-declaration cannot refer to a destructor for a base class. — end note]

However, a destructor is similar to a constructor in most respects. A constructor does not have a name as per [class.ctor.general] p1 but it can be referred to by a using-declaration. Again, a constructor can be found, as per [class.qual] p1, a destructor can also be found as per [basic.lookup.qual.general] p4. We explicitly say a using-declaration can name a constructor but we do not have a formal rule that specifies a using-declaration cannot refer to a destructor. We expect that there is a formal rule in [namespace.udecl] as like:

the unqualified-id in a using-declarator shall not denote a destructor.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @xmh0511

        Issue actions

          [namespace.udecl] Lack a sufficient rule to specify using-declaration cannot refer to a destructor · Issue #5448 · cplusplus/draft