<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2479</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="2479"></A><H4>2479.
  
Missing specifications for <TT>consteval</TT> and <TT>constinit</TT>
</H4>
<B>Section: </B>6.10.3.1&#160; [<A href="https://wg21.link/basic.start.main">basic.start.main</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Davis Herring
 &#160;&#160;&#160;

 <B>Date: </B>2020-10-09<BR>


<P>[Accepted as a DR at the June, 2021 meeting.]</P>

<P>There are several places where the <TT>consteval</TT>
and/or <TT>constinit</TT> keywords should be mentioned but
are not:</P>

<P>6.10.3.1 [<A href="https://wg21.link/basic.start.main#3">basic.start.main</A>] paragraph 3:</P>

<BLOCKQUOTE>

A program that defines <TT>main</TT>
as deleted or that declares <TT>main</TT>
to be <TT>inline</TT>, <TT>static</TT>, or <TT>constexpr</TT>
is ill-formed.

</BLOCKQUOTE>

<P>9.3.4.1 [<A href="https://wg21.link/dcl.meaning.general#2">dcl.meaning.general</A>] paragraph 2:</P>

<BLOCKQUOTE>

A <TT>static</TT>, <TT>thread_local</TT>,
<TT>extern</TT>, <TT>mutable</TT>, <TT>friend</TT>,
<TT>inline</TT>, <TT>virtual</TT>, <TT>constexpr</TT>,
or <TT>typedef</TT> specifier or
an <I>explicit-specifier</I> applies directly to
each <I>declarator-id</I> in an <I>init-declarator-list</I>
or <I>member-declarator-list</I>...

</BLOCKQUOTE>

<P>11.4.5.1 [<A href="https://wg21.link/class.ctor.general#1">class.ctor.general</A>] paragraph 1:</P>

<BLOCKQUOTE>

...In a constructor declaration, each <I>decl-specifier</I> in
the optional <I>decl-specifier-seq</I> shall be <TT>friend</TT>,
<TT>inline</TT>, <TT>constexpr</TT>, or an <I>explicit-specifier</I>.

</BLOCKQUOTE>

<P><B>Proposed resolution, May, 2021:</B></P>

<OL>
<LI><P>Change 6.10.3.1 [<A href="https://wg21.link/basic.start.main#3">basic.start.main</A>] paragraph 3
as follows:</P></LI>

<BLOCKQUOTE>

...A program that defines <TT>main</TT> as deleted or that
declares <TT>main</TT> to
be <TT>inline</TT>, <TT>static</TT>, <DEL>or</DEL>
<TT>constexpr</TT><INS>, or <TT>consteval</TT></INS>
is ill-formed...

</BLOCKQUOTE>

<LI><P>Change 9.3.4.1 [<A href="https://wg21.link/dcl.meaning.general#4">dcl.meaning.general</A>] paragraph 4 as follows:</P></LI>

<BLOCKQUOTE>

A <TT>static</TT>, <TT>thread_local</TT>, <TT>extern</TT>,
<TT>mutable</TT>, <TT>friend</TT>, <TT>inline</TT>,
<TT>virtual</TT>, <TT>constexpr</TT>, <INS><TT>consteval</TT>,
<TT>constinit</TT>,</INS> or <TT>typedef</TT> specifier or
an <I>explicit-specifier</I> applies directly to
each <I>declarator-id</I> in a declaration; the type
specified for each <I>declarator-id</I> depends on both
the <I>decl-specifier-seq</I> and its <I>declarator</I>.

</BLOCKQUOTE>

<LI><P>Change 11.4.5.1 [<A href="https://wg21.link/class.ctor.general#5">class.ctor.general</A>] paragraph 5 as follows:</P></LI>

<BLOCKQUOTE>

...Constructors do not have names. In a constructor
declaration, each <I>decl-specifier</I> in the
optional <I>decl-specifier-seq</I> shall be <TT>friend</TT>,
<TT>inline</TT>, <TT>constexpr</TT>, <INS><TT>consteval</TT>,</INS>
or an <I>explicit-specifier</I>.

</BLOCKQUOTE>

</OL>

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