Title
Dead code for constructor names
Status
cd3
Section
9.3 [dcl.decl]
Submitter
Johannes Schaub

Created on 2011-08-27.00:00:00 last changed 123 months ago

Messages

Date: 2012-10-15.00:00:00

[Moved to DR at the October, 2012 meeting.]

Date: 2012-02-15.00:00:00

Proposed resolution (February, 2012):

  1. Change 9.3 [dcl.decl] paragraph 4 as follows:

    • ...
      declarator-id:
        ...opt id-expression
        nested-name-specifieropt class-name

    A class-name has special meaning in a declaration of the class of that name and when qualified by that name using the scope resolution operator :: (5.1 [lex.separate], 11.4.5 [class.ctor], 11.4.7 [class.dtor]).

  2. Change _N4567_.5.1.1 [expr.prim.general] paragraph 8 as follows:

  3. ...[Note: a class member can be referred to using a qualified-id at any point in its potential scope (6.4.7 [basic.scope.class]). —end note] Where class-name :: class-name is used, and the two class-names refer to the same class, this notation names the constructor (11.4.5 [class.ctor]). Where class-name ::~ class-name is used...
Date: 2017-02-06.00:00:00

Issue 147 changed the name lookup rules so that a lookup that would have found the injected-class-name of a class will refer to the constructor. However, there still appear to be vestiges of the earlier specification that were not removed by the resolution. For example, the grammar in 9.3 [dcl.decl] paragraph 4 contains,

    declarator-id:
      ...opt id-expression
      nested-name-specifieropt class-name

It would seem that there is no longer any need for the second line, since a lookup for a declarator-id will not produce a class-name. Similarly, _N4567_.5.1.1 [expr.prim.general] paragraph 8 still contains the sentence,

Where class-name :: class-name is used, and the two class-names refer to the same class, this notation names the constructor (11.4.5 [class.ctor]).
History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: drwp -> cd3
2013-05-03 00:00:00adminsetstatus: dr -> drwp
2012-11-03 00:00:00adminsetmessages: + msg4143
2012-11-03 00:00:00adminsetstatus: ready -> dr
2012-02-27 00:00:00adminsetmessages: + msg3718
2012-02-27 00:00:00adminsetstatus: open -> ready
2011-08-27 00:00:00admincreate