<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 919</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="919"></A><H4>919.
  
Contradictions regarding inline namespaces
</H4>
<B>Section: </B>9.9.2&#160; [<A href="https://wg21.link/namespace.def">namespace.def</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Michael Wong
 &#160;&#160;&#160;

 <B>Date: </B>19 June, 2009<BR>


<P>[Voted into WP at March, 2010 meeting as part of document N3079.]</P>

<P>According to 9.9.2 [<A href="https://wg21.link/namespace.def#8">namespace.def</A>] paragraph 8,</P>

<BLOCKQUOTE>

Members of an inline namespace can be used in most respects as though
they were members of the enclosing namespace... Furthermore, each
member of the inline namespace can subsequently be explicitly
instantiated (13.9.3 [<A href="https://wg21.link/temp.explicit">temp.explicit</A>]) or explicitly specialized
(13.9.4 [<A href="https://wg21.link/temp.expl.spec">temp.expl.spec</A>]) as though it were a member of the
enclosing namespace.

</BLOCKQUOTE>

<P>However, that assertion is contradicted for class template
specializations by Clause 11 [<A href="https://wg21.link/class#11">class</A>] paragraph 11:</P>

<BLOCKQUOTE>

If a <I>class-head</I> contains a <I>nested-name-specifier</I>,
the <I>class-specifier</I> shall refer to a class that was
previously declared directly in the class or namespace to which the
<I>nested-name-specifier</I> refers...

</BLOCKQUOTE>

<P>It is also contradicted for function template specializations by
6.5.5.3 [<A href="https://wg21.link/namespace.qual#6">namespace.qual</A>] paragraph 6:</P>

<BLOCKQUOTE>

In a declaration for a namespace member in which the
<I>declarator-id</I> is a <I>qualified-id</I>, given that
the <I>qualified-id</I> for the namespace member has the
form

<UL><I>nested-name-specifier unqualified-id</I></UL>

the <I>unqualified-id</I> shall name a member of the namespace
designated by the <I>nested-name-specifier</I>.

</BLOCKQUOTE>

<P><B>Proposed resolution (November, 2009):</B></P>

<OL>
<LI><P>Change Clause 11 [<A href="https://wg21.link/class#11">class</A>] paragraph 11 as follows:</P></LI>

<BLOCKQUOTE>

If a <I>class-head</I> contains a <I>nested-name-specifier</I>,
the <I>class-specifier</I> shall refer to a class that was
previously declared directly in the class or namespace to which the
<I>nested-name-specifier</I> refers<INS>, or in an element of the
inline namespace set (9.9.2 [<A href="https://wg21.link/namespace.def">namespace.def</A>]) of that
namespace</INS> (i.e., <DEL>neither</DEL> <INS>not merely</INS>
inherited <DEL>nor</DEL> <INS>or</INS> introduced by a
<I>using-declaration</I>), and the <I>class-specifier</I> shall appear
in a namespace enclosing the previous declaration.

</BLOCKQUOTE>

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

<BLOCKQUOTE>

<P>In a declaration for a namespace member in which the
<I>declarator-id</I> is a <I>qualified-id</I>, given that the
<I>qualified-id</I> for the namespace member has the form</P>

<UL><I>nested-name-specifier unqualified-id</I></UL>

<P>the <I>unqualified-id</I> shall name a member of the namespace
designated by the <I>nested-name-specifier</I><INS>, or of an
element of the inline namespace (9.9.2 [<A href="https://wg21.link/namespace.def">namespace.def</A>]) of that
namespace</INS>. [<I>Example:</I>...</P>

</BLOCKQUOTE>

</OL>

<P>(Note: this resolution depends on the resolution for
<A HREF="861.html">issue 861</A>.)</P>

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