<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1887</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="1887"></A><H4>1887.
  
Problems with <TT>::</TT> as <I>nested-name-specifier</I>
</H4>
<B>Section: </B>9.10&#160; [<A href="https://wg21.link/namespace.udecl">namespace.udecl</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Jeff Snyder
 &#160;&#160;&#160;

 <B>Date: </B>2014-03-04<BR>


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



<P>
<A HREF="1411.html">Issue 1411</A> added <TT>::</TT> as a
production for <I>nested-name-specifier</I>.  However, the grammar
for <I>using-declaration</I>s should have been updated but was
overlooked:</P>

<UL>
<I>using-declaration:</I>
<UL>
<TT>using typename</TT><I><SUB>opt</SUB> nested-name-specifier unqualified-id</I> <TT>;</TT><BR>
<TT>using ::</TT> <I>unqualified-id</I> <TT>;</TT>
</UL>
</UL>

<P>In addition, there is some verbiage in 6.5.5.3 [<A href="https://wg21.link/namespace.qual#1">namespace.qual</A>] paragraph 1
and 9.10 [<A href="https://wg21.link/namespace.udecl#9">namespace.udecl</A>] paragraph 9 that should
probably be revised.</P>

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

<OL>
<LI><P>Change the grammar in 9.10 [<A href="https://wg21.link/namespace.udecl#1">namespace.udecl</A>] paragraph 1
as follows:</P></LI>

<UL>
<I>using-declaration:</I>
<UL>
<TT>using typename</TT><I><SUB>opt</SUB> nested-name-spaceifier unqualified-id</I> <TT>;</TT><BR>
<DEL><TT>using ::</TT> <I>unqualified-id</I> <TT>;</TT></DEL>
</UL>
</UL>

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

<BLOCKQUOTE>

If the <I>nested-name-specifier</I> of a <I>qualified-id</I>
nominates a namespace <INS>(including the case where the
<I>nested-name-specifier</I> is <TT>::</TT>, i.e., nominating
the global namespace)</INS>, the name specified after
the <I>nested-name-specifier</I> is looked up in the scope
of the namespace. <DEL>If a <I>qualified-id</I> starts with <TT>::</TT>,
the name after the <TT>::</TT> is looked up in the global
namespace. In either case, the</DEL> <INS>The</INS> names in
a <I>template-argument</I> of a <I>template-id</I> are
looked up in the context in which the
entire <I>postfix-expression</I> occurs.

</BLOCKQUOTE>

<LI><P>Change _N4567_.5.1.1 [<A href="https://wg21.link/expr.prim.general#10">expr.prim.general</A>] paragraph 10 as follows:</P></LI>

<BLOCKQUOTE>

<DEL>A <TT>::</TT>, or a</DEL> <INS>The <I>nested-name-specifier</I>
<TT>::</TT> names the global
namespace. A</INS> <I>nested-name-specifier</I> that names a
namespace (9.9 [<A href="https://wg21.link/basic.namespace">basic.namespace</A>]), <DEL>in either case</DEL>
followed by the name of a member of that namespace (or the
name of a member of a namespace made visible by
a <I>using-directive</I>)<INS>,</INS> is a <I>qualified-id</I>;
6.5.5.3 [<A href="https://wg21.link/namespace.qual">namespace.qual</A>] describes name lookup for
namespace members that appear in <I>qualified-id</I>s. The
result is...

</BLOCKQUOTE>

<LI><P>Change 9.10 [<A href="https://wg21.link/namespace.udecl#9">namespace.udecl</A>] paragraph 9 as follows:</P></LI>

<BLOCKQUOTE>

Members declared by a <I>using-declaration</I> can be
referred to by explicit qualification just like other member
names (6.5.5.3 [<A href="https://wg21.link/namespace.qual">namespace.qual</A>]). <DEL>In
a <I>using-declaration</I>, a prefix <TT>::</TT> refers to the global
namespace.</DEL> [<I>Example:</I>

</BLOCKQUOTE>

</OL>

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