<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 942</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="942"></A><H4>942.
  
Is <TT>this</TT> an entity?
</H4>
<B>Section: </B>6.1&#160; [<A href="https://wg21.link/basic.pre">basic.pre</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Maurer
 &#160;&#160;&#160;

 <B>Date: </B>14 July, 2009<BR>


<P>[Voted into WP at March, 2010 meeting.]</P>

<P>At least in the new wording for 7.5.6 [<A href="https://wg21.link/expr.prim.lambda#10">expr.prim.lambda</A>] paragraph 10
as found in paper N2927, <TT>this</TT> is explicitly assumed to be an
entity.  It should be investigated whether <TT>this</TT> should be added
to the list of entities found in 6.1 [<A href="https://wg21.link/basic.pre#3">basic.pre</A>] paragraph 3.</P>

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

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

<BLOCKQUOTE>

An <I>entity</I> is a value, object, variable, reference, function,
enumerator, type, class member, template, template specialization,
namespace, <DEL>or</DEL> parameter pack<INS>, or <TT>this</TT></INS>.

</BLOCKQUOTE>

<LI><P>Change 6.3 [<A href="https://wg21.link/basic.def.odr#2">basic.def.odr</A>] paragraph 2 as follows:</P></LI>

<BLOCKQUOTE>

...is immediately applied. <INS><TT>this</TT> is used if it appears as
a potentially-evaluated expression (including as the result of the
implicit transformation in the body of a non-static member function
(11.4.3 [<A href="https://wg21.link/class.mfct.non.static">class.mfct.non.static</A>])).</INS> A virtual member function...

</BLOCKQUOTE>

<LI><P>Delete 7.5.6 [<A href="https://wg21.link/expr.prim.lambda#7">expr.prim.lambda</A>] paragraph 7:</P></LI>

<BLOCKQUOTE>

<DEL>For the purpose of describing the behavior of
<I>lambda-expression</I>s below, <TT>this</TT> is considered to be
&#8220;used&#8221; if replacing <TT>this</TT> by an invented variable
<TT>v</TT> with automatic storage duration and the same type as
<TT>this</TT> would result in <TT>v</TT> being used (6.3 [<A href="https://wg21.link/basic.def.odr">basic.def.odr</A>]).</DEL>

</BLOCKQUOTE>

</OL>

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