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
Do destructors have names? #414
Comments
@zygoloid, is this non-editorial? It seems like "the destructor name" could be changed to talk about the id-expression in a postfix expression, except that [expr.call] says that has to be a function member name, and the destructor doesn't have a name:
This makes me think of the White Knight explaining that "The song's name is called Haddocks' Eyes". |
If I'm not mistaken, a qualified-id is not a name, therefore that sentence is in itself erroneous. For the same reason, I think that the grammar term pseudo-destructor-name is poorly named. If |
Certain _use_s of some kinds of unqualified-id above are considered as names. "~ class-name" is unqualified-id, but not listed here. What does "use" precisely mean? |
We have a precise definition for "name", but we don't stick to it. For instance: [basic.def.odr]p3: "A variable whose name appears as a potentially-evaluated expression ex is odr-used by ex unless [...]" Later on in p6, we have the same problem; the ODR doesn't take the declarative region of the entity into account. And so on. We really need a comprehensive study of where "name" is used and misused. I've forwarded this to CWG for discussion as to how best to proceed. |
This is obsolete, the wording has been fixed. It now says "the destructor is specified by a |
Fixed by CWG 2069. |
N4296 7.3.3 [namespace.udecl]/4 says
Since destructors do not have names, a using-declaration cannot refer to a destructor for a base class.
But 12.4 [class.dtor]/13 mentions "the destructor name" (in the sentenceIn an explicit destructor call, the destructor name appears as a ~ followed by a type-name or decltype-specifier that denotes the destructor’s class type.
)So, do destructors have names or not?
The text was updated successfully, but these errors were encountered: