<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 719</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="719"></A><H4>719.
  
Specifications for <I>operator-function-id</I> that should also apply to <I>literal-operator-id</I>
</H4>
<B>Section: </B>6.1&#160; [<A href="https://wg21.link/basic.pre">basic.pre</A>]
 &#160;&#160;&#160;

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

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

 <B>Date: </B>19 September, 2008<BR>


<P>[Voted into WP at October, 2009 meeting.]</P>

<P>When user-defined literals were added, a new form of operator
function was created.  Presumably many of the existing
specifications that deal with <I>operator-function-id</I>s (the
definition of <I>name</I>, for instance, in paragraph 4 of
6.1 [<A href="https://wg21.link/basic.pre">basic.pre</A>]) should also apply to
<I>literal-operator-id</I>s.</P>

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

<OL>
<LI><P>Change 6.1 [<A href="https://wg21.link/basic.pre#4">basic.pre</A>] paragraph 4 as follows:</P></LI>

<BLOCKQUOTE>

A <I>name</I> is a use of an <I>identifier</I> (5.11 [<A href="https://wg21.link/lex.name">lex.name</A>]),
<I>operator-function-id</I> (12.4 [<A href="https://wg21.link/over.oper">over.oper</A>]),
<INS><I>literal-operator-id</I> (12.6 [<A href="https://wg21.link/over.literal">over.literal</A>]),</INS>
<I>conversion-function-id</I> (11.4.8.3 [<A href="https://wg21.link/class.conv.fct">class.conv.fct</A>]), or
<I>template-id</I> (13.3 [<A href="https://wg21.link/temp.names">temp.names</A>]) that denotes an entity
or <I>label</I> (8.8.6 [<A href="https://wg21.link/stmt.goto">stmt.goto</A>], 8.2 [<A href="https://wg21.link/stmt.label">stmt.label</A>]).

</BLOCKQUOTE>

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

<BLOCKQUOTE>

The operator <TT>::</TT> followed by an <I>identifier</I>, a
<I>qualified-id</I>, <DEL>or</DEL> an <I>operator-function-id</I><INS>, or a
<I>literal-operator-id</I></INS> is a
<I>primary-expression</I>.  Its type is specified by the declaration
of the identifier, <I>qualified-id</I>, <DEL>or</DEL>
<I>operator-function-id</I><INS>, or <I>literal-operator-id</I></INS>.
The result is the entity denoted by the identifier,
<I>qualified-id</I>, <DEL>or</DEL> <I>operator-function-id</I><INS>, or
<I>literal-operator-id</I></INS>. The result is an
lvalue if the entity is a function or variable.  The identifier,
<I>qualified-id</I>, <DEL>or</DEL> <I>operator-function-id</I><INS>, or
<I>literal-operator-id</I></INS> shall have global namespace scope or be
visible in global scope because of a
<I>using-directive</I> (9.9.4 [<A href="https://wg21.link/namespace.udir">namespace.udir</A>])...

</BLOCKQUOTE>

<LI><P>Add the following production to the grammar for
<I>qualified-id</I> in _N4567_.5.1.1 [<A href="https://wg21.link/expr.prim.general#7">expr.prim.general</A>] paragraph 7:</P></LI>

<UL>
<I>qualified-id:</I>
<UL>
<TT>::</TT><I><SUB>opt</SUB> nested-name-specifier</I> <TT>template</TT><I><SUB>opt</SUB> unqualified-id</I>
</UL>
<UL>
<TT>::</TT> <I>identifier</I>
</UL>
<UL>
<TT>::</TT> <I>operator-function-id</I>
</UL>
<UL><INS><TT>::</TT> <I>literal-operator-id</I></INS></UL>
<UL>
<TT>::</TT> <I>template-id</I>
</UL>
</UL>

<LI><P>Add the following production to the grammar for
<I>template-id</I> in 13.3 [<A href="https://wg21.link/temp.names#1">temp.names</A>] paragraph 1:</P></LI>

<UL>
<I>template-id:</I>
<UL><I>simple-template-id</I></UL>
<UL>
<I>operator-function-id</I> <TT>&lt;</TT> <I>template-argument-list<SUB>opt</SUB></I> <TT>&gt;</TT>
</UL>
<UL><INS><I>literal-operator-id</I> <TT>&lt;</TT> <I>template-argument-list<SUB>opt</SUB></I> <TT>&gt;</TT></INS></UL>
</UL>

<LI><P>Change 13.3 [<A href="https://wg21.link/temp.names#3">temp.names</A>] paragraph 3 as follows:</P></LI>

<BLOCKQUOTE>

After name lookup (6.5 [<A href="https://wg21.link/basic.lookup">basic.lookup</A>]) finds that a name is a
<I>template-name</I>, or that an <I>operator-function-id</I> <INS>or a
<I>literal-operator-id</I></INS> refers to a set of overloaded functions
any member of which is a function template...

</BLOCKQUOTE>

<LI><P>Change 13.6 [<A href="https://wg21.link/temp.type#1.1">temp.type</A>] bullet 1.1 as
follows:</P></LI>

<UL><LI><P>their <I>template-name</I>s<INS>,</INS> <DEL>or</DEL>
<I>operator-function-id</I>s<INS>, or <I>literal-operator-id</I>s</INS>
refer to the same template, and</P></LI></UL>

</OL>

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