<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1271</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="1271"></A><H4>1271.
  
Imprecise wording regarding dependent types
</H4>
<B>Section: </B>13.8&#160; [<A href="https://wg21.link/temp.res">temp.res</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

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


<P>[Accepted as a DR at the March, 2018 (Jacksonville) meeting as part of paper
P0634R3.]</P>

<P>According to 13.8 [<A href="https://wg21.link/temp.res#3">temp.res</A>] paragraph 3,</P>

<BLOCKQUOTE>

When a <I>qualified-id</I> is intended to refer to a type that is not
a member of the current instantiation (13.8.3.2 [<A href="https://wg21.link/temp.dep.type">temp.dep.type</A>])
and its <I>nested-name-specifier</I> refers to a dependent type, it
shall be prefixed by the keyword <TT>typename</TT>, forming a
<I>typename-specifier</I>.  If the <I>qualified-id</I> in a
<I>typename-specifier</I> does not denote a type, the program is ill-
formed.

</BLOCKQUOTE>

<P>The intent of the programmer cannot form the basis for a compiler
determining whether to issue a diagnostic or not.</P>

<U>Suggested resolution:</U>

<BLOCKQUOTE>

<P>Let <TT>N</TT> be a <I>qualified-id</I> with a
<I>nested-name-specifier</I> that denotes a dependent type.  If
<TT>N</TT> is not prefixed by the keyword <TT>typename</TT>, <TT>N</TT>
shall refer to a member of the current instantiation or it shall not
refer to a type.</P>

<UL>
<I>typename-specifier:</I>
<UL>
<TT>typename</TT> <I>nested-name-specifier identifier</I><BR>
<TT>typename</TT> <I>nested-name-specifier </I><TT>template</TT><I><SUB>opt</SUB> simple-template-id</I>
</UL>
</UL>

<P>If the <I>qualified-id</I> in a <I>typename-specifier</I> does not
denote a type, the program is ill-formed.</P>

</BLOCKQUOTE>

<P>(See also issues <A HREF="590.html">590</A> and
<A HREF="591.html">591</A>.)</P>

<P><B>Notes from the November, 2016 meeting:</B></P>

<P>The resolution for this issue should describe the type to which a
<I>typename-specifier</I> refers, effectively the type named by the
corresponding <I>simple-type-specifier</I> with <TT>typename</TT>
removed.</P>

<P><B>Notes from the November, 2017 meeting:</B></P>

<P>This topic is addressed in paper P0634.</P>

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