<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2347</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="2347"></A><H4>2347.
  
Passing short scoped enumerations to ellipsis
</H4>
<B>Section: </B>7.6.1.3&#160; [<A href="https://wg21.link/expr.call">expr.call</A>]
 &#160;&#160;&#160;

 <B>Status: </B>C++20
 &#160;&#160;&#160;

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

 <B>Date: </B>2017-04-28<BR>


<P>[Adopted as a DR at the November, 2019 meeting.]</P>

<P>According to 7.6.1.3 [<A href="https://wg21.link/expr.call#9">expr.call</A>] paragraph 9,</P>

<BLOCKQUOTE>

If the argument has integral or enumeration type that is subject to the
integral promotions (7.3.7 [<A href="https://wg21.link/conv.prom">conv.prom</A>]), or a floating-point type
that is subject to the floating-point promotion (7.3.8 [<A href="https://wg21.link/conv.fpprom">conv.fpprom</A>]),
the value of the argument is converted to the promoted type before the
call. These promotions are referred to as the default argument promotions.

</BLOCKQUOTE>

<P>A scoped enumeration with an underlying type that is shorter than
<TT>int</TT> will not be widened when passed to an ellipsis. Should it
be?</P>

<P><B>Notes from the June, 2018 meeting:</B></P>

<P>The consensus of CWG was that the value passed ougnt to be widened
to match the promoted type of the underlying type.</P>

<P><B>Proposed resolution (May, 2019): [SUPERSEDED]</B></P>

<P>Change 7.6.1.3 [<A href="https://wg21.link/expr.call#12">expr.call</A>] paragraph 12 as follows:</P>

<BLOCKQUOTE>

...If the argument has <INS>an</INS>
integral or enumeration type that is
subject to the integral promotions
(7.3.7 [<A href="https://wg21.link/conv.prom">conv.prom</A>]), <INS>a scoped enumeration type
whose underlying type is subject to the integral promotions,</INS>
or a floating-point type that
is subject to the floating-point promotion
(7.3.8 [<A href="https://wg21.link/conv.fpprom">conv.fpprom</A>]), the value of the argument is
converted to the promoted type before the call. These
promotions are referred to as the <I>default argument
promotions</I>.

</BLOCKQUOTE>

<P><B>Notes from the September, 2019 teleconference:</B></P>

<P>The consensus was that passing scoped enumerations to ellipsis
should be conditionally-supported behavior, similar to the
treatment of class types with nontrivial copy semantics.</P>

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

<P>Change 7.6.1.3 [<A href="https://wg21.link/expr.call#12">expr.call</A>] paragraph 12 as follows:</P>

<BLOCKQUOTE>

...Passing a potentially-evaluated argument of <INS>a scoped
enumeration type or of a</INS> class type (
Clause 11 [<A href="https://wg21.link/class">class</A>]) having an eligible non-trivial copy
constructor, an eligible non-trivial move constructor, or a
non-trivial destructor (11.4.4 [<A href="https://wg21.link/special">special</A>]), with
no corresponding parameter, is conditionally-supported with
implementation-defined semantics. If the argument...

</BLOCKQUOTE>

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