Title
Inconsistent class scope and completeness rules
Status
cd3
Section
6.4.7 [basic.scope.class]
Submitter
Richard Smith

Created on 2011-08-16.00:00:00 last changed 130 months ago

Messages

Date: 2012-02-15.00:00:00

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

Date: 2011-08-15.00:00:00

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.]
Date: 2011-08-16.00:00:00

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.

History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: drwp -> cd3
2012-11-03 00:00:00adminsetstatus: dr -> drwp
2012-02-27 00:00:00adminsetmessages: + msg3787
2012-02-27 00:00:00adminsetstatus: ready -> dr
2011-09-06 00:00:00adminsetmessages: + msg3424
2011-08-16 00:00:00admincreate