<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2509</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="2509"></A><H4>2509.
  
<I>decl-specifier-seq</I> in <I>lambda-specifiers</I>
</H4>
<B>Section: </B>7.5.6.1&#160; [<A href="https://wg21.link/expr.prim.lambda.general">expr.prim.lambda.general</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Jens Maurer
 &#160;&#160;&#160;

 <B>Date: </B>2021-10-28<BR>


<P>[Accepted at the February, 2022 meeting.]</P>

<P>(From editorial issue
<A HREF="https://github.com/cplusplus/draft/pull/2338">2338</A>.)</P>

<P>Use of <I>decl-specifier-seq</I> in the production for
<I>lambda-specifiers</I> is too general and should be
restricted.</P>

<P><B>Proposed resolution (December, 2021):</B></P>

<OL>
<LI><P>Change the grammar in 7.5.6.1 [<A href="https://wg21.link/expr.prim.lambda.general">expr.prim.lambda.general</A>] as follows:</P></LI>

<UL>
<I>lambda-specifiers:</I>
<UL>
<I><DEL>decl</DEL><INS>lambda</INS>-specifier-seq<SUB>opt</SUB> noexcept-specifier<SUB>opt</SUB> attribute-specifier-seq<SUB>opt</SUB> trailing-return-type<SUB>opt</SUB></I>
</UL>
</UL>

<UL>
<INS><I>lambda-specifier:</I></INS>
<UL>
<INS><TT>consteval</TT></INS><BR>
<INS><TT>constexpr</TT></INS><BR>
<INS><TT>mutable</TT></INS>
</UL>
</UL>

<UL>
<INS><I>lambda-specifier-seq:</I></INS>
<UL>
<INS><I>lambda-specifier</I></INS><BR>
<INS><I>lambda-specifier lambda-specifier-seq</I></INS>
</UL>
</UL>

<LI><P>Change 7.5.6.1 [<A href="https://wg21.link/expr.prim.lambda.general">expr.prim.lambda.general</A>] paragrap 3 as follows:</P></LI>

<BLOCKQUOTE>

<DEL>In the <I>decl-specifier-seq</I> of
the <I>lambda-declarator</I>, each <I>decl-specifier</I>
shall be one of <TT>mutable</TT>, <TT>constexpr</TT>, or
<TT>consteval</TT>.</DEL> <INS>A <I>lambda-specifier-seq</I>
shall contain at most one of each <I>lambda-specifier</I>
and shall not contain both <TT>constexpr</TT> and
<TT>consteval</TT>.</INS> If the <I>lambda-declarator</I>
contains an explicit object parameter
(9.3.4.6 [<A href="https://wg21.link/dcl.fct">dcl.fct</A>]), then
no <I><DEL>decl</DEL><INS>lambda</INS>-specifier</I> in
the <I><DEL>decl</DEL><INS>lambda</INS>-specifier-seq</I>
shall be <TT>mutable</TT>.

</BLOCKQUOTE>

</OL>

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