This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 116a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-12-19


1920. Qualification mismatch in pseudo-destructor-name

Section: _N4778_.7.6.1.4  [expr.pseudo]     Status: CD4     Submitter: David Majnemer     Date: 2014-05-01

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

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.

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

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