<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 52</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="52"></A><H4>52.
  
Non-static members, member selection and access checking
</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>TC1
 &#160;&#160;&#160;

 <B>Submitter: </B>Steve Adamczyk
 &#160;&#160;&#160;

 <B>Date: </B>13 Oct 1998<BR>



<P>7.6.1.5 [<A href="https://wg21.link/expr.ref#4">expr.ref</A>] paragraph 4
should make
it clear that when a nonstatic member is referenced in a member
selection operation, the type of the left operand is implicitly cast
to the naming class of the member. This allows for the detection of
access and ambiguity errors on that implicit cast.</P>

<P><B>Proposed Resolution (10/00):</B></P>

<OL>

<LI>
<P>In 11.8.3 [<A href="https://wg21.link/class.access.base#4">class.access.base</A>] paragraph 4, remove the following
from the second note:</P>

<BLOCKQUOTE>

If the member <TT>m</TT> is accessible when named in the naming
class according to the rules below, the access to <TT>m</TT> is
nonetheless ill-formed if the type of <TT>p</TT> cannot be
implicitly converted to type <TT>T</TT> (for example, if <TT>T</TT> is an
inaccessible base class of <TT>p</TT>'s class).

</BLOCKQUOTE>
</LI>

<LI>
<P>Add the following as a new paragraph 5 of
11.8.3 [<A href="https://wg21.link/class.access.base">class.access.base</A>]:</P>

<BLOCKQUOTE>

If a class member access operator, including an
implicit "<TT>this-&gt;</TT>," is used to access a nonstatic
data member or nonstatic member function, the
reference is ill-formed if the left operand
(considered as a pointer in the "." operator case)
cannot be implicitly converted to a pointer to the
naming class of the right operand.  [<I>Note:</I> this
requirement is in addition to the requirement that the
member be accessible as named.]

</BLOCKQUOTE>
</LI>

<LI>
<P>In 11.8.3 [<A href="https://wg21.link/class.access.base#4">class.access.base</A>] paragraph 4, fix a typographical
error by adding the missing right parenthesis following the text</P>

<BLOCKQUOTE>

(including cases where an implicit "<TT>this-&gt;</TT>" is added

</BLOCKQUOTE>
</LI>

<LI>
<P>Add following the first sentence of
7.6.1.3 [<A href="https://wg21.link/expr.call#4">expr.call</A>] paragraph 4:</P>

<BLOCKQUOTE>

If the function is a nonstatic member function, the
"<TT>this</TT>" parameter of the function (_N4868_.11.4.3.2 [<A href="https://wg21.link/class.this">class.this</A>]) shall
be initialized with a pointer to the object of the
call, converted as if by an explicit type conversion
(7.6.3 [<A href="https://wg21.link/expr.cast">expr.cast</A>]).  [<I>Note:</I> there is no access checking on
this conversion; the access checking is done as part of
the (possibly implicit) class member access operator.
See 11.8.3 [<A href="https://wg21.link/class.access.base">class.access.base</A>].]

</BLOCKQUOTE>
</LI>

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