<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1261</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="1261"></A><H4>1261.
  
Explicit handling of cv-qualification with non-class prvalues
</H4>
<B>Section: </B>Clause 7&#160; [<A href="https://wg21.link/expr">expr</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Nikolay Ivchenkov
 &#160;&#160;&#160;

 <B>Date: </B>2011-03-12<BR>


<P>[Moved to DR at the October, 2012 meeting.]</P>



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

<OL>
<LI><P>Change 7.2.1 [<A href="https://wg21.link/basic.lval#4">basic.lval</A>] paragraph 4 as
follows (supersedes the corresponding change in the resolution of
<A HREF="1059.html">issue 1059</A>):</P></LI>

<BLOCKQUOTE>

<DEL>Class prvalues can have cv-qualified types; non-class
prvalues always have cv-unqualified types.</DEL> Unless otherwise
indicated (7.6.1.3 [<A href="https://wg21.link/expr.call">expr.call</A>]), prvalues shall always
have complete types or the <TT>void</TT> type; in addition to
these types, glvalues can also have incomplete types.
<INS>[<I>Note:</I> class and array prvalues can have cv-qualified
types; other prvalues always have cv-unqualified types.  See
Clause 7 [<A href="https://wg21.link/expr">expr</A>].  &#8212;<I>end note</I>]</INS>

</BLOCKQUOTE>

<LI><P>Add a new paragraph following Clause 7 [<A href="https://wg21.link/expr#5">expr</A>] paragraph 5:
</P></LI>

<BLOCKQUOTE>

<P>If an expression initially has the type &#8220;reference to
<TT>T</TT>&#8221;...</P>

<P><INS>If a prvalue initially has the type &#8220;<I>cv</I>
<TT>T</TT>,&#8221; where <TT>T</TT> is a cv-unqualified
non-class, non-array type, the type of the expression is adjusted
to <TT>T</TT> prior to any further analysis.</INS></P>

</BLOCKQUOTE>

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

<BLOCKQUOTE>

If the <I>postfix-expression</I> designates a destructor
(11.4.7 [<A href="https://wg21.link/class.dtor">class.dtor</A>]), the type of the function call
expression is <TT>void</TT>; otherwise, the type of the function
call expression is the return type of the statically chosen
function (i.e., ignoring the <TT>virtual</TT> keyword), even if
the type of the function actually called is different. This
<INS>return</INS> type shall be an object type, a reference type
or <DEL>the type</DEL> <INS><I>cv</I></INS> <TT>void</TT>.

</BLOCKQUOTE>

<LI><P>Change 7.6.1.4 [<A href="https://wg21.link/expr.type.conv#2">expr.type.conv</A>] paragraph 2 as follows:</P></LI>

<BLOCKQUOTE>

...[<I>Note:</I> if <TT>T</TT> is a non-class type that is cv-qualified, the
<I>cv-qualifier</I>s are <DEL>ignored</DEL> <INS>discarded</INS>
when determining the type of the resulting prvalue
(<DEL>7.2.1 [<A href="https://wg21.link/basic.lval">basic.lval</A>]</DEL> <INS>
Clause 7 [<A href="https://wg21.link/expr">expr</A>]</INS>). &#8212;<I>end note</I>]

</BLOCKQUOTE>

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

<BLOCKQUOTE>

...[<I>Note:</I> if <TT>T</TT> is a non-class type that is
<DEL><I>cv-qualified</I></DEL> <INS>cv-qualified</INS>, the
<I>cv-qualifier</I>s are <DEL>ignored</DEL> <INS>discarded</INS>
when determining the type of the resulting prvalue; see
<DEL>7.2.1 [<A href="https://wg21.link/basic.lval">basic.lval</A>]</DEL> <INS>
Clause 7 [<A href="https://wg21.link/expr">expr</A>]</INS>. &#8212;<I>end note</I>]

</BLOCKQUOTE>

</OL>

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