Movatterモバイル変換


[0]ホーム

URL:


Issue 1382 - WG21 CWG Issues
Title
Dead code for constructor names
Status
cd3
Section
9.3 [dcl.decl]
Submitter
Johannes Schaub

Created on2011-08-27.00:00:00 last changed143 months ago

Messages

msg4143 (view)
Date: 2012-10-15.00:00:00

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

msg3718 (view)
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

    Aclass-name has special meaning in a declaration of theclass of that name and when qualified by that name using the scoperesolution 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 aqualified-id at any point in its potential scope (6.4.7 [basic.scope.class]). —end note]Whereclass-name::class-name is used, and the twoclass-namesrefer to the same class, this notation names the constructor(11.4.5 [class.ctor]). Whereclass-name::~class-name is used...
msg3629 (view)
Date: 2017-02-06.00:00:00

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

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

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

Whereclass-name::class-name is used,and the twoclass-names refer to the same class, thisnotation names the constructor (11.4.5 [class.ctor]).
History
DateUserActionArgs
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

[8]ページ先頭

©2009-2025 Movatter.jp