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

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

Messages

Date: 2000-04-15.00:00:00

Proposed Resolution (10/00):

  1. In 14.2 [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 14.2 [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 14.2 [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 8.2.2 [expr.call] paragraph 4:

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

8.2.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