Title
decltype-specifier in nested-name-specifier of destructor
Status
cd4
Section
6.5.5 [basic.lookup.qual]
Submitter
John Spicer

Created on 2013-09-18.00:00:00 last changed 94 months ago

Messages

Date: 2014-11-15.00:00:00

[Moved to DR at the November, 2014 meeting.]

Date: 2014-02-15.00:00:00

Proposed resolution (February, 2014):

Change the grammar in 7.6.1 [expr.post] paragraph 1 as follows:

    pseudo-destructor-name:
      nested-name-specifieropt type-name :: ~ type-name
      nested-name-specifier template simple-template-id :: ~ type-name
      nested-name-specifieropt ~ type-name
      ~ decltype-specifier
Date: 2020-12-15.00:00:00

One of the forms of pseudo-destructor-name is

    nested-name-specifieropt ~ type-name

Presumably the intent of this form is to allow the nested-name-specifier to designate a namespace; otherwise the

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

production would be used.

Since one of the forms of nested-name-specifier is

    decltype-specifier ::

one can write something like p->decltype(x)::~Y(). However, the lookup rules in 6.5.5 [basic.lookup.qual] paragraph 6 are inappropriate for the decltype-specifier case:

If a pseudo-destructor-name (_N4778_.7.6.1.4 [expr.pseudo]) contains a nested-name-specifier, the type-names are looked up as types in the scope designated by the nested-name-specifier.

Since this form appears to be useless (use of a decltype-specifier is permitted after a ~, but only with no nested-name-specifer — but see issue 1586), perhaps it should be made ill-formed.

History
Date User Action Args
2017-02-06 00:00:00adminsetstatus: drwp -> cd4
2015-05-25 00:00:00adminsetstatus: dr -> drwp
2015-04-13 00:00:00adminsetmessages: + msg5328
2014-11-24 00:00:00adminsetstatus: ready -> dr
2014-03-03 00:00:00adminsetmessages: + msg4800
2014-03-03 00:00:00adminsetstatus: open -> ready
2013-09-18 00:00:00admincreate