<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1308</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="1308"></A><H4>1308.
  
Completeness of class type within an <I>exception-specification</I>
</H4>
<B>Section: </B>11.4&#160; [<A href="https://wg21.link/class.mem">class.mem</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Nikolay Ivchenkov
 &#160;&#160;&#160;

 <B>Date: </B>2011-05-03<BR>


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



<P>According to 11.4 [<A href="https://wg21.link/class.mem#2">class.mem</A>] paragraph 2,</P>

<BLOCKQUOTE>

A class is considered a completely-defined object type (6.9 [<A href="https://wg21.link/basic.types">basic.types</A>]) (or complete type) at the closing <TT>}</TT> of the
<I>class-specifier</I>.  Within the class <I>member-specification</I>,
the class is regarded as complete within function bodies, default
arguments, <I>exception-specification</I>s, and
<I>brace-or-equal-initializer</I>s for non-static data members
(including such things in nested classes).  Otherwise it is regarded
as incomplete within its own class <I>member-specification</I>.

</BLOCKQUOTE>

<P>With the advent of the <TT>noexcept</TT> operator, treating the
class type as complete in <I>exception-specification</I>s is obviously
not possible, e.g.,</P>

<PRE>
  struct X {
    //<SPAN CLASS="cmnt"> should </SPAN>X<SPAN CLASS="cmnt"> be considered as complete here?</SPAN>
    static void create() noexcept(noexcept(X()));
    X() noexcept(!noexcept(X::create()));
  };
</PRE>

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

<OL>
<LI><P>Change 11.4 [<A href="https://wg21.link/class.mem#2">class.mem</A>] paragraph 2 as follows:</P></LI>

<BLOCKQUOTE>

A class is considered a completely-defined object type (6.9 [<A href="https://wg21.link/basic.types">basic.types</A>]) (or complete type) at the closing <TT>}</TT> of the
<I>class-specifier</I>.  Within the class <I>member-specification</I>,
the class is regarded as complete within function bodies, default
arguments, <DEL><I>exception-specification</I>s,</DEL> and
<I>brace-or-equal-initializers</I> for non-static data members
(including such things in nested classes).  Otherwise it is regarded
as incomplete within its own class <I>member-specification</I>.

</BLOCKQUOTE>

<LI><P>Change 14.5 [<A href="https://wg21.link/except.spec#2">except.spec</A>] paragraph 2 as follows:</P></LI>

<BLOCKQUOTE>

...A type denoted in an <I>exception-specification</I> shall not
denote an incomplete type <INS>other than a class currently being
defined</INS>.  A type denoted in an
<I>exception-specification</I> shall not denote a pointer or reference
to an incomplete type, other than <INS><I>cv</I></INS>
<TT>void*</TT><DEL>, <TT>const void*</TT>, <TT>volatile void*</TT>, or
<TT>const volatile void*</TT></DEL> <INS>or a pointer or reference to
a class currently being defined</INS>.  A type <I>cv</I> <TT>T</TT>,
&#8220;array of <TT>T</TT>&#8221;, or &#8220;function returning
<TT>T</TT>&#8221; denoted in an <I>exception-specification</I> is
adjusted to type <TT>T</TT>, &#8220;pointer to <TT>T</TT>&#8221;, or
&#8220;pointer to function returning <TT>T</TT>&#8221;, respectively.

</BLOCKQUOTE>

</OL>

<P><B>Note:</B></P>

<P>This change was subsequently removed by the resolution of
<A HREF="1330.html">issue 1330</A>.</P>

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