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

[class.this] restriction on constructors and destructors has nothing to do with this pointer #2347

Closed
AlisdairM opened this issue Oct 9, 2018 · 2 comments
Assignees

Comments

@AlisdairM
Copy link
Contributor

[class.this]p4 is the constraint that constructors/destructors do not have cv-qualifiers. It probably belong better in [class.mfct.non-static] after its p4, that talks about cv-qualifiers on non-static member functions.

p5 talks about ref-qualifiers on non-static member functions, and I don't see anything stating that this does not apply to ctors/dtors. If that falls out of the grammar, then perhaps this cv-restriction would go the same way, and this paragraph should be demoted to a note? Otherwise, there may be a CWG issue needs to be opened on ref-qualifiers on constructors? (Just as likely I missed this restriction in another cross-reference, in which case it would be good to call that out here too.)

@jensmaurer
Copy link
Member

Both [class.ctor] and [class.dtor] present limited declarator syntax for constructors/destructors, which does not allow for cv-qualifiers or ref-qualifiers.

@AlisdairM
Copy link
Contributor Author

OK, so no concerns with ref-qualfiers, but moving the paragraph into a more appropriate clause still makes sense.

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

2 participants