<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1882</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="1882"></A><H4>1882.
  
Reserved names without library use
</H4>
<B>Section: </B>_N4140_.17.6.4.3.2&#160; [<A href="https://wg21.link/global.names">global.names</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Mike Miller
 &#160;&#160;&#160;

 <B>Date: </B>2014-02-26<BR>


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

<P>The section of the Standard reserving names that begin with two
underscores or an underscore and a capital letter,
_N4140_.17.6.4.3.2 [<A href="https://wg21.link/global.names">global.names</A>], applies only to &#8220;programs that
use the facilities of the C++ standard library&#8221;
(16.4.5.1 [<A href="https://wg21.link/constraints.overview">constraints.overview</A>]).  However, implementations rely on
this restriction for mangling, even when no standard library facilities
are used.  Should this requirement be moved to the core language
section?</P>

<P>(There is a related issue with user-defined literal suffixes,
16.4.5.3.6 [<A href="https://wg21.link/usrlit.suffix">usrlit.suffix</A>].  However, these are already mentioned
normatively in the core language section, so it could be argued
that the question of library usage does not apply.)</P>

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

<OL>
<LI><P>Change 5.11 [<A href="https://wg21.link/lex.name#3">lex.name</A>] paragraph 3 as follows:</P></LI>

<BLOCKQUOTE>

<P>In addition, some identifiers are reserved for use by C++
implementations <DEL>and standard libraries
(_N4140_.17.6.4.3.2 [<A href="https://wg21.link/global.names">global.names</A>])</DEL> and shall not be used
otherwise; no diagnostic is required.</P>

<UL>
<LI><P><INS>Each identifier that contains a double understore
<TT>__</TT> or begins with an underscore followed by an uppercase
letter is reserved to the implementation for any use.</INS></P></LI>

<LI><P><INS>Each identifier that begins with an underscore is
reserved to the implementation for use as a name in the global
namespace.</INS></P></LI>

</UL>

</BLOCKQUOTE>

<LI><P>Change the footnote in 9.6.1 [<A href="https://wg21.link/dcl.fct.def.general#8">dcl.fct.def.general</A>] paragraph 8
as follows:</P></LI>

<BLOCKQUOTE>

[<I>Footnote:</I> Implementations are permitted to provide additional
predefined variables with names that are reserved to the
implementation (<DEL>_N4140_.17.6.4.3.2 [<A href="https://wg21.link/global.names">global.names</A>]</DEL>
<INS>5.11 [<A href="https://wg21.link/lex.name">lex.name</A>]</INS>). If a predefined
variable is not odr-used (6.3 [<A href="https://wg21.link/basic.def.odr">basic.def.odr</A>]), its
string value need not be present in the program
image. &#8212;<I>end footnote</I>]

</BLOCKQUOTE>

<LI><P>Change the example in 12.6 [<A href="https://wg21.link/over.literal#8">over.literal</A>] paragraph 8
as follows:</P></LI>

<PRE>
  double operator""_Bq(double);  //<SPAN CLASS="cmnt"> OK: does not use the reserved <DEL>name</DEL> <INS>identifier</INS> </SPAN>_Bq<SPAN CLASS="cmnt"> (<DEL>_N4140_.17.6.4.3.2 [<A href="https://wg21.link/global.names">global.names</A>]</DEL> <INS>5.11 [<A href="https://wg21.link/lex.name">lex.name</A>]</INS>)</SPAN>
  double operator"" _Bq(double); //<SPAN CLASS="cmnt"> uses the reserved <DEL>name</DEL> <INS>identifier</INS> </SPAN>_Bq<SPAN CLASS="cmnt"> (<DEL>_N4140_.17.6.4.3.2 [<A href="https://wg21.link/global.names">global.names</A>]</DEL> <INS>5.11 [<A href="https://wg21.link/lex.name">lex.name</A>]</INS>)</SPAN>
</PRE>

<LI><P>Delete _N4140_.17.6.4.3.2 [<A href="https://wg21.link/global.names">global.names</A>]:</P></LI>

<BLOCKQUOTE>

<P><DEL>Certain sets of names and function signatures are always
reserved to the implementation:</DEL></P>

<UL>
<LI><P><DEL>Each name that contains a double underscore __ or begins
with an underscore followed by an uppercase letter
(5.12 [<A href="https://wg21.link/lex.key">lex.key</A>]) is reserved to the
implementation for any use.</DEL></P></LI>

<LI><P><DEL>Each name that begins with an underscore is reserved to the
implementation for use as a name in the global namespace.</DEL></P></LI>

</UL>

</BLOCKQUOTE>

</OL>

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