<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1487</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="1487"></A><H4>1487.
  
When are inheriting constructors declared?
</H4>
<B>Section: </B>_N4527_.12.9&#160; [<A href="https://wg21.link/class.inhctor">class.inhctor</A>]
 &#160;&#160;&#160;

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

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

 <B>Date: </B>2012-03-27<BR>


<P>[Moved to DR at the April, 2013 meeting.]</P>



<P>According to _N4527_.12.9 [<A href="https://wg21.link/class.inhctor#3">class.inhctor</A>] paragraph 3,</P>

<BLOCKQUOTE>

For each non-template constructor in the candidate set of inherited
constructors other than a constructor having no parameters or a
copy/move constructor having a single parameter, a constructor is
implicitly declared with the same constructor characteristics unless
there is a user-declared constructor with the same signature in the
class where the <I>using-declaration</I> appears.

</BLOCKQUOTE>

<P>It is not clear whether that determination is intended to include
constructors declared after the point of the <I>using-declaration</I>
or not.</P>

<P><B>Proposed resolution (February, 2013):</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, <INS><I>using-declaration</I>s introducing inheriting
constructors (_N4527_.12.9 [<A href="https://wg21.link/class.inhctor">class.inhctor</A>]),</INS> 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>

<LI><P>Change 11.4.4 [<A href="https://wg21.link/special#1">special</A>] paragraph 1 as follows:</P></LI>

<BLOCKQUOTE>

...See 11.4.5 [<A href="https://wg21.link/class.ctor">class.ctor</A>], 11.4.7 [<A href="https://wg21.link/class.dtor">class.dtor</A>] and
11.4.5.3 [<A href="https://wg21.link/class.copy.ctor">class.copy.ctor</A>].  &#8212;<I>end note</I>] <INS>An
implicitly-declared special member function is declared at the closing
<TT>}</TT> of the <I>class-specifier</I>.</INS> Programs shall not
define implicitly-declared special member functions.

</BLOCKQUOTE>

<LI><P>Change _N4527_.12.9 [<A href="https://wg21.link/class.inhctor#3">class.inhctor</A>] paragraph 3 as follows:</P></LI>

<BLOCKQUOTE>

For each non-template constructor in the candidate set of inherited
constructors other than a constructor having no parameters or a
copy/move constructor having a single parameter, a constructor is
implicitly declared with the same constructor characteristics unless
there is a user-declared constructor with the same signature in the
<INS>complete</INS> class where the <I>using-declaration</I> appears.
Similarly, for each constructor template in the candidate set of
inherited constructors, a constructor template is implicitly declared
with the same constructor characteristics unless there is an
equivalent user-declared constructor template (13.7.7.2 [<A href="https://wg21.link/temp.over.link">temp.over.link</A>]) in the <INS>complete</INS> class where the
<I>using-declaration</I> appears.  [<I>Note:</I> Default arguments are
not inherited.  An <I>exception-specification</I> is implied as
specified in 14.5 [<A href="https://wg21.link/except.spec">except.spec</A>]. &#8212;<I>end note</I>]

</BLOCKQUOTE>

</OL>

<P><B>Additional note (January, 2013):</B></P>

<P>A question has been raised  as to
whether it is necessary to prohibit inheriting constructors from
base classes that are also enclosing classes when the derived class
is defined outside the <I>member-specification</I> of the enclosing
class.  This issue has been returned to "review" status to allow
discussion of this question.</P>

<P><B>Additional note (February, 2013):</B></P>

<P>It was observed that it is not permitted to derive from an
incomplete class, which prevents the problem intended to be addressed
by the prohibition of inheriting constructors from an enclosing
class without disallowing such usage when the nested class is defined
outside its enclosing class.  That restriction has been removed from
the proposed resolution.</P>

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