<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2614</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="2614"></A><H4>2614.
  
Unspecified results for class member access
</H4>
<B>Section: </B>7.6.1.5&#160; [<A href="https://wg21.link/expr.ref">expr.ref</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Andrey Erokhin
 &#160;&#160;&#160;

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


<P>[Accepted as a DR at the November, 2022 meeting.]</P>

<P>Subclause 7.6.1.5 [<A href="https://wg21.link/expr.ref#6">expr.ref</A>] paragraph 6 specifies:</P>

<BLOCKQUOTE>

If <TT>E2</TT> is declared to have type &#8220;reference
to <TT>T</TT>&#8221;, then <TT>E1.E2</TT> is an lvalue; the type
of <TT>E1.E2</TT> is <TT>T</TT>. Otherwise, ...

</BLOCKQUOTE>

<P>This does not specifiy which object or functiom the resulting
lvalue designates.  A similar problem exists with member enumerators:</P>

<BLOCKQUOTE>

If <TT>E2</TT> is a member enumerator and the type of <TT>E2</TT>
is <TT>T</TT>, the expression <TT>E1.E2</TT> is a prvalue. The type
of <TT>E1.E2</TT> is <TT>T</TT>.

</BLOCKQUOTE>

<P><B>Proposed resolution (approved by CWG 2022-09-23):</B></P>

<OL>
<LI>
<P>Split and change in 7.6.1.5 [<A href="https://wg21.link/expr.ref#6">expr.ref</A>] paragraph 6 as follows:</P>

<BLOCKQUOTE>

<P>
If <TT>E2</TT> is declared to have type &#8220;reference
to <TT>T</TT>&#8221;, then <TT>E1.E2</TT> is an lvalue<DEL>; the</DEL> <INS>of</INS> type
<DEL>of <TT>E1.E2</TT> is</DEL> <TT>T</TT>. <INS>If <TT>E2</TT> is a
static data member, <TT>E1.E2</TT> designates the object or function
to which the reference is bound, otherwise <TT>E1.E2</TT> designates
the object or function to which the corresponding reference member
of <TT>E1</TT> is bound.</INS>
</P>

<P>Otherwise, ...</P>

</BLOCKQUOTE>
</LI>

<LI>
<P>Change in 7.6.1.5 [<A href="https://wg21.link/expr.ref#6.5">expr.ref</A>] bullet 6.5 as follows:</P>

<BLOCKQUOTE>

If <TT>E2</TT> is a member enumerator and the type of <TT>E2</TT>
is <TT>T</TT>, the expression <TT>E1.E2</TT> is a
prvalue<DEL>. The</DEL> <INS>of</INS> type <DEL>of <TT>E1.E2</TT>
is</DEL> <TT>T</TT> <INS>whose value is the value of the
enumerator</INS>.

</BLOCKQUOTE>

</LI>
</OL>

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