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

2024-09-25


1875. Reordering declarations in class scope

Section: 6.4.7  [basic.scope.class]     Status: CD4     Submitter: Richard Smith     Date: 2014-02-19

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

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?

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.