Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
xmh0511 opened this issue May 5, 2022 · 0 comments

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented May 5, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant