Created on 2010-12-13.00:00:00 last changed 46 months ago
Rationale (February, 2021):
This issue is a duplicate of, and resolved by the resolution of, issue 1971.
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:00 | admin | set | messages: + msg6520 |
2021-02-24 00:00:00 | admin | set | status: open -> dup |
2010-12-13 00:00:00 | admin | create |