Title
Non-static members, member selection and access checking
Status
tc1
Section
7.6.1.5 [expr.ref]
Submitter
Steve Adamczyk

Created on 1998-10-13.00:00:00 last changed 262 months ago

Messages

Date: 2000-10-15.00:00:00

Proposed Resolution (10/00):

  1. In 11.8.3 [class.access.base] paragraph 4, remove the following from the second note:

    If the member m is accessible when named in the naming class according to the rules below, the access to m is nonetheless ill-formed if the type of p cannot be implicitly converted to type T (for example, if T is an inaccessible base class of p's class).
  2. Add the following as a new paragraph 5 of 11.8.3 [class.access.base]:

    If a class member access operator, including an implicit "this->," 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. [Note: this requirement is in addition to the requirement that the member be accessible as named.]
  3. In 11.8.3 [class.access.base] paragraph 4, fix a typographical error by adding the missing right parenthesis following the text

    (including cases where an implicit "this->" is added
  4. Add following the first sentence of 7.6.1.3 [expr.call] paragraph 4:

    If the function is a nonstatic member function, the "this" parameter of the function (_N4868_.11.4.3.2 [class.this]) shall be initialized with a pointer to the object of the call, converted as if by an explicit type conversion (7.6.3 [expr.cast]). [Note: 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 [class.access.base].]
Date: 2003-04-25.00:00:00

7.6.1.5 [expr.ref] 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.

History
Date User Action Args
2003-04-25 00:00:00adminsetstatus: dr -> tc1
2000-11-18 00:00:00adminsetstatus: ready -> dr
2000-05-21 00:00:00adminsetstatus: drafting -> ready
1999-09-14 00:00:00adminsetmessages: + msg92
1999-09-14 00:00:00adminsetstatus: open -> drafting
1998-10-13 00:00:00admincreate