<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1352</TITLE>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<STYLE TYPE="text/css">
  INS { text-decoration:none; font-weight:bold; background-color:#A0FFA0 }
  .INS { text-decoration:none; background-color:#D0FFD0 }
  DEL { text-decoration:line-through; background-color:#FFA0A0 }
  .DEL { text-decoration:line-through; background-color: #FFD0D0 }
  @media (prefers-color-scheme: dark) {
    HTML { background-color:#202020; color:#f0f0f0; }
    A { color:#5bc0ff; }
    A:visited { color:#c6a8ff; }
    A:hover, a:focus { color:#afd7ff; }
    INS { background-color:#033a16; color:#aff5b4; }
    .INS { background-color: #033a16; }
    DEL { background-color:#67060c; color:#ffdcd7; }
    .DEL { background-color:#67060c; }
  }
  SPAN.cmnt { font-family:Times; font-style:italic }
</STYLE>
</HEAD>
<BODY>
<P><EM>This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21
  Core Issues List revision 118b.
  See http://www.open-std.org/jtc1/sc22/wg21/ for the official
  list.</EM></P>
<P>2025-09-28</P>
<HR>
<A NAME="1352"></A><H4>1352.
  
Inconsistent class scope and completeness rules
</H4>
<B>Section: </B>6.4.7&#160; [<A href="https://wg21.link/basic.scope.class">basic.scope.class</A>]
 &#160;&#160;&#160;

 <B>Status: </B>CD3
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2011-08-16<BR>


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



<P>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.</P>

<P><B>Proposed resolution (August, 2011):</B></P>

<OL>
<LI><P>Change 6.4.7 [<A href="https://wg21.link/basic.scope.class#1">basic.scope.class</A>] paragraph 1 as follows:</P></LI>

<OL><LI>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, <INS>default arguments, and</INS>
<I>brace-or-equal-initializer</I>s of non-static data members<DEL>,
and default arguments</DEL> in that class (including such things in
nested classes).</LI></OL>

<LI><P>Change 6.5.3 [<A href="https://wg21.link/basic.lookup.unqual#7">basic.lookup.unqual</A>] paragraph 7 as follows:</P></LI>

<BLOCKQUOTE>

A name used in the definition of a class X outside of a member
function body<INS>, default argument,
<I>brace-or-equal-initializer</I> of a non-static data member,</INS>
or nested class definition<SUP>29</SUP> shall be declared in one of
the following ways:...

</BLOCKQUOTE>

<LI><P>Change 6.5.3 [<A href="https://wg21.link/basic.lookup.unqual#8">basic.lookup.unqual</A>] paragraph 8 as follows:</P></LI>

<BLOCKQUOTE>

<DEL>A</DEL> <INS>For the members of a class <TT>X</TT>, a</INS> name
used <INS>in a member function body, in a default argument, in the
<I>brace-or-equal-initializer</I> of a non-static data member
(11.4 [<A href="https://wg21.link/class.mem">class.mem</A>]), or</INS> in the definition of a
<INS>class</INS> member <DEL>function (11.4.2 [<A href="https://wg21.link/class.mfct">class.mfct</A>]) of
class <TT>X</TT></DEL> <INS>outside of the definition of
<TT>X</TT>,</INS> following the <DEL>function's</DEL>
<INS>member's</INS> <I>declarator-id</I> [<I>Footnote:</I> That is, an
unqualified name that occurs, for instance, in a type <DEL>or default
argument</DEL> in the <I>parameter-declaration-clause</I> or in the
<DEL>function
body</DEL> <INS><I>exception-specification</I></INS>. &#8212;<I>end
footnote</I>]<INS>,</INS> <DEL>or in the
<I>brace-or-equal-initializer</I> of a non-static data member
(11.4 [<A href="https://wg21.link/class.mem">class.mem</A>]) of class <TT>X</TT></DEL> shall be declared
in one of the following ways:...

</BLOCKQUOTE>

</OL>

<I>[Drafting note: 11.4 [<A href="https://wg21.link/class.mem#2">class.mem</A>] paragraph 2 requires no
changes.  6.4.7 [<A href="https://wg21.link/basic.scope.class#1.5">basic.scope.class</A>] 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.]</I>

<BR><BR>
</BODY>
</HTML>
