<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1925</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="1925"></A><H4>1925.
  
Bit-field prvalues
</H4>
<B>Section: </B>7.6.20&#160; [<A href="https://wg21.link/expr.comma">expr.comma</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-05-12<BR>


<P>[Moved to DR at the May, 2015 meeting.]</P>

<P>According to 7.6.20 [<A href="https://wg21.link/expr.comma#1">expr.comma</A>] paragraph 1,</P>

<BLOCKQUOTE>

The type and value of the result are the type and value of the right
operand; the result is of the same value category as its right operand, and
is a bit-field if its right operand is a glvalue and a bit-field.

</BLOCKQUOTE>

<P>The description of a bit-field result seems to indicate that the
operand might not be a glvalue but could still be a bit-field.  There
doesn't appear to be a normative prohibition against prvalue
bit-fields, so one should presumably be added, and this wording
should be adjusted to remove the suggestion that such a thing might
exist.</P>

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

<OL>
<LI><P>Change 7.2.1 [<A href="https://wg21.link/basic.lval#2">basic.lval</A>] paragraph 2 as follows:</P></LI>

<BLOCKQUOTE>

Whenever a glvalue appears in a context where a prvalue is
expected, the glvalue is converted to a prvalue; see
7.3.2 [<A href="https://wg21.link/conv.lval">conv.lval</A>], 7.3.3 [<A href="https://wg21.link/conv.array">conv.array</A>], and
7.3.4 [<A href="https://wg21.link/conv.func">conv.func</A>]. [<I>Note:</I> An attempt to bind
an rvalue reference to an lvalue is not such a context; see
9.5.4 [<A href="https://wg21.link/dcl.init.ref">dcl.init.ref</A>]. &#8212;<I>end note</I>]
<INS>[<I>Note:</I> There are no prvalue bit-fields; if a
bit-field is converted to a prvalue (7.3.2 [<A href="https://wg21.link/conv.lval">conv.lval</A>]),
a prvalue of the type of the bit-field is created, which might
then be promoted (7.3.7 [<A href="https://wg21.link/conv.prom">conv.prom</A>]). &#8212;<I>end note</I>]</INS>

</BLOCKQUOTE>

<LI><P>Change 7.6.20 [<A href="https://wg21.link/expr.comma#1">expr.comma</A>] paragraph 1 as follows:</P></LI>

<BLOCKQUOTE>

...The type and value of the result are the type and value
of the right operand; the result is of the same value
category as its right operand, and is a bit-field if its
right operand is <DEL>a glvalue and</DEL> a bit-field. If
the value...

</BLOCKQUOTE>

</OL>

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