<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2155</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="2155"></A><H4>2155.
  
Defining classes and enumerations via <I>using-declaration</I>s
</H4>
<B>Section: </B>_N4868_.9.8.2.3&#160; [<A href="https://wg21.link/namespace.memdef">namespace.memdef</A>]
 &#160;&#160;&#160;

 <B>Status: </B>C++17
 &#160;&#160;&#160;

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

 <B>Date: </B>2015-07-05<BR>


<P>[Moved to DR at the November, 2016 meeting.]</P>

<P>The resolution of <A HREF="1838.html">issue 1838</A> was
intended to resolve <A HREF="1021.html">issue 1021</A> but does
not actually do so, as it applies only to declarations with a
<I>declarator-id</I>, which is not true of classes and enumerations.
</P>

<P><B>Proposed resolution (October, 2015):</B></P>

<OL>
<LI><P>Change _N4868_.9.8.2.3 [<A href="https://wg21.link/namespace.memdef#1">namespace.memdef</A>] paragraph 1 as
follows:</P></LI>

<BLOCKQUOTE>

A declaration in a namespace <TT>N</TT> (excluding declarations in
nested scopes) whose <I>declarator-id</I> is
an <I>unqualified-id</I> <INS>(9.3.4 [<A href="https://wg21.link/dcl.meaning">dcl.meaning</A>]), whose
<I>class-head-name</I> (Clause 11 [<A href="https://wg21.link/class">class</A>]) or
<I>enum-head-name</I> (9.8.1 [<A href="https://wg21.link/dcl.enum">dcl.enum</A>]) is an
<I>identifier</I>, or whose <I>elaborated-type-specifier</I> is
of the form <I>class-key attribute-specifier-seq<SUB>opt</SUB>
identifier</I> (9.2.9.5 [<A href="https://wg21.link/dcl.type.elab">dcl.type.elab</A>]), or that is an
<I>opaque-enum-declaration</I>,</INS> declares (or redeclares)
<INS>its <I>unqualified-id</I> or <I>identifier</I> as</INS> a member
of <TT>N</TT><DEL>, and may be a definition</DEL>. [<I>Note:</I>...

</BLOCKQUOTE>

<LI><P>Change the grammar of 9.8.1 [<A href="https://wg21.link/dcl.enum">dcl.enum</A>] as follows:</P></LI>

<UL>
<I>enum-head</I>:
<UL>
<I>enum-key attribute-specifier-seq<SUB>opt</SUB> <DEL>identifier</DEL> <INS>enum-head-name</INS><SUB>opt</SUB> enum-base<SUB>opt</SUB></I><BR>
<DEL><I>enum-key attribute-specifier-seq<SUB>opt</SUB> nested-name-specifier identifier enum-base<SUB>opt</SUB></I></DEL>
</UL>
<INS><I>enum-head-name:</I></INS>
<UL>
<INS><I>nested-name-specifier<SUB>opt</SUB> identifier</I></INS>
</UL>
</UL>

</OL>

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