Title
Qualification mismatch in pseudo-destructor-name
Status
cd4
Section
_N4778_.7.6.1.4 [expr.pseudo]
Submitter
David Majnemer

Created on 2014-05-01.00:00:00 last changed 95 months ago

Messages

Date: 2015-05-15.00:00:00

[Moved to DR at the May, 2015 meeting.]

Date: 2014-11-15.00:00:00

Proposed resolution (November, 2014):

Change _N4778_.7.6.1.4 [expr.pseudo] paragraph 2 as follows:

...The cv-unqualified versions of the object type and of the type designated by the pseudo-destructor-name shall be the same type. Furthermore, the two type-names in a pseudo-destructor-name of the form

    nested-name-specifieropt type-name :: ~ type-name

shall designate the same scalar type (ignoring cv-qualification).

Date: 2020-12-15.00:00:00

An example like

  typedef int T;
  typedef const T CT;

  void blah2(T *a) {
   a->CT::~T();
  }

is ill-formed, because _N4778_.7.6.1.4 [expr.pseudo] paragraph 2 requires that the two type-names in the qualified-id be the same type. The corresponding case for a real destructor, however, is allowed because of the provision in 11.3 [class.name] paragraph 5 ignoring cv-qualifiers in a typedef-name referring to a class type. The specification for pseudo-destructors should be adjusted accordingly.

History
Date User Action Args
2017-02-06 00:00:00adminsetstatus: drwp -> cd4
2015-11-10 00:00:00adminsetstatus: dr -> drwp
2015-05-25 00:00:00adminsetmessages: + msg6045
2015-05-25 00:00:00adminsetstatus: tentatively ready -> dr
2014-11-24 00:00:00adminsetmessages: + msg5162
2014-11-24 00:00:00adminsetstatus: drafting -> tentatively ready
2014-07-07 00:00:00adminsetstatus: open -> drafting
2014-05-01 00:00:00admincreate