<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2874</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="2874"></A><H4>2874.
  
Qualified declarations of partial specializations
</H4>
<B>Section: </B>9.2.9.5&#160; [<A href="https://wg21.link/dcl.type.elab">dcl.type.elab</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Krystian Stasiowski
 &#160;&#160;&#160;

 <B>Date: </B>2024-03-19<BR>


<P>[Accepted as a DR at the June, 2024 meeting.]</P>

<P>(From submission
<A HREF="https://github.com/cplusplus/CWG/issues/521">#521</A>.)</P>

<P>Consider:</P>

<PRE>
  namespace N {
    template&lt;typename T&gt;
    struct A;
  }

  template&lt;&gt;
  struct N::A&lt;int&gt;;     //<SPAN CLASS="cmnt"> OK</SPAN>

  template&lt;typename T&gt;
  struct N::A&lt;T*&gt;;      //<SPAN CLASS="cmnt"> error: invalid use of elaborated-type-specifier with a qualified-id</SPAN>
</PRE>

<P>However, all major implementations support this.</P>

<P><B>Proposed resolution (approved by CWG 2024-05-17):</B></P>

<P>Change in 9.2.9.5 [<A href="https://wg21.link/dcl.type.elab#2">dcl.type.elab</A>] paragraph 2 as follows:</P>

<BLOCKQUOTE>

If an <I>elaborated-type-specifier</I> is the sole constituent of a
declaration, the declaration is ill-formed unless it is an explicit
specialization (13.9.4 [<A href="https://wg21.link/temp.expl.spec">temp.expl.spec</A>]),
<INS>a partial specialization (13.7.6 [<A href="https://wg21.link/temp.spec.partial">temp.spec.partial</A>]),</INS> an
explicit instantiation (13.9.3 [<A href="https://wg21.link/temp.explicit">temp.explicit</A>])<INS>,</INS> or it
has one of the following forms:
<PRE>
  <I>class-key</I> <I>attribute-specifier-seqopt</I> <I>identifier</I> ;
  <I>class-key</I> <I>attribute-specifier-seqopt</I> <I>simple-template-id</I> ;
</PRE>
In the first case, the <I>elaborated-type-specifier</I> declares the
identifier as a <I>class-name</I>. The second case shall appear only
in an <I>explicit-specialization</I> (13.9.4 [<A href="https://wg21.link/temp.expl.spec">temp.expl.spec</A>]) or
in a <I>template-declaration</I> (where it declares a partial
specialization <DEL>(13.7 [<A href="https://wg21.link/temp.decls">temp.decls</A>])</DEL>.
The <I>attribute-specifier-seq</I>, if any, appertains to the class or
template being declared.

</BLOCKQUOTE>

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