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

2024-03-20


1352. Inconsistent class scope and completeness rules

Section: 6.4.7  [basic.scope.class]     Status: CD3     Submitter: Richard Smith     Date: 2011-08-16

[Voted into the WP at the February, 2012 meeting; moved to DR at the October, 2012 meeting.]

The rules regarding class scope and when the class is considered to be complete (normally implemented by deferred parsing of portions of class member declarations) are inconsistent and need to be clarified.

Proposed resolution (August, 2011):

  1. Change 6.4.7 [basic.scope.class] paragraph 1 as follows:

    1. The potential scope of a name declared in a class consists not only of the declarative region following the name's point of declaration, but also of all function bodies, default arguments, and brace-or-equal-initializers of non-static data members, and default arguments in that class (including such things in nested classes).
  2. Change 6.5.3 [basic.lookup.unqual] paragraph 7 as follows:

  3. A name used in the definition of a class X outside of a member function body, default argument, brace-or-equal-initializer of a non-static data member, or nested class definition29 shall be declared in one of the following ways:...
  4. Change 6.5.3 [basic.lookup.unqual] paragraph 8 as follows:

  5. A For the members of a class X, a name used in a member function body, in a default argument, in the brace-or-equal-initializer of a non-static data member (11.4 [class.mem]), or in the definition of a class member function (11.4.2 [class.mfct]) of class X outside of the definition of X, following the function's member's declarator-id [Footnote: That is, an unqualified name that occurs, for instance, in a type or default argument in the parameter-declaration-clause or in the function body exception-specification. —end footnote], or in the brace-or-equal-initializer of a non-static data member (11.4 [class.mem]) of class X shall be declared in one of the following ways:...
[Drafting note: 11.4 [class.mem] paragraph 2 requires no changes. 6.4.7 [basic.scope.class] bullet 1.5 deals with out-of-class definitions, and bullet 2 ensures that the lookup results for argument types are the same for in-class and out-of-class declarations, so no change is required.]