Title
Confusing description of ambiguity of destructor name
Status
dup
Section
7.6.2.2 [expr.unary.op]
Submitter
Johannes Schaub

Created on 2010-12-13.00:00:00 last changed 46 months ago

Messages

Date: 2021-02-15.00:00:00

Rationale (February, 2021):

This issue is a duplicate of, and resolved by the resolution of, issue 1971.

Date: 2022-11-20.07:54:16

According to 7.6.2.2 [expr.unary.op] paragraph 10,

There is an ambiguity in the unary-expression ~X(), where X is a class-name or decltype-specifier. The ambiguity is resolved in favor of treating ~ as a unary complement rather than treating ~X as referring to a destructor.

It is not clear whether this is intended to apply to an expression like (~S)(). In large measure, that depends on whether a class-name is an id-expression or not. If it is, the ambiguity described in 7.6.2.2 [expr.unary.op] paragraph 10 does apply; if not, the expression is an unambiguous reference to the destructor for class S. There are several places in the Standard that indicate that the name of a type is an id-expression, but that might be more confusing than helpful.

History
Date User Action Args
2021-02-24 00:00:00adminsetmessages: + msg6520
2021-02-24 00:00:00adminsetstatus: open -> dup
2010-12-13 00:00:00admincreate