Title
Reordering declarations in class scope
Status
cd4
Section
6.4.7 [basic.scope.class]
Submitter
Richard Smith

Created on 2014-02-19.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-06-15.00:00:00

Proposed resolution (June, 2014):

Delete the third item of 6.4.7 [basic.scope.class] paragraph 1 and renumber the succeeding items:

  1. If reordering member declarations in a class yields an alternate valid program under (1) and (2), the program is ill-formed, no diagnostic is required.

Date: 2014-02-19.00:00:00

The rules for class scope in 6.4.7 [basic.scope.class] paragraph 1 include the following:

  1. A name N used in a class S shall refer to the same declaration in its context and when re-evaluated in the completed scope of S. No diagnostic is required for a violation of this rule.

  2. If reordering member declarations in a class yields an alternate valid program under (1) and (2), the program is ill-formed, no diagnostic is required.

The need for rule #3 is not clear; it would seem that any otherwise-valid reordering would have to violate rule #2 in order to yield a different interpretation. Taken literally, rule #3 would also apply to simply reordering nonstatic data members with no name dependencies at all. Can it be simply removed?

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: + msg6039
2015-05-25 00:00:00adminsetstatus: ready -> dr
2014-07-07 00:00:00adminsetmessages: + msg5063
2014-07-07 00:00:00adminsetstatus: open -> ready
2014-02-19 00:00:00admincreate