Movatterモバイル変換


[0]ホーム

URL:


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

Created on1998-10-13.00:00:00 last changed277 months ago

Messages

msg92 (view)
Date: 2000-10-15.00:00:00

Proposed Resolution (10/00):

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

    If the memberm is accessible when named in the namingclass according to the rules below, the access tom isnonetheless ill-formed if the type ofp cannot beimplicitly converted to typeT (for example, ifT is aninaccessible base class ofp's class).
  2. Add the following as a new paragraph 5 of11.8.3 [class.access.base]:

    If a class member access operator, including animplicit "this->," is used to access a nonstaticdata member or nonstatic member function, thereference is ill-formed if the left operand(considered as a pointer in the "." operator case)cannot be implicitly converted to a pointer to thenaming class of the right operand. [Note: thisrequirement is in addition to the requirement that themember be accessible as named.]
  3. In 11.8.3 [class.access.base] paragraph 4, fix a typographicalerror by adding the missing right parenthesis following the text

    (including cases where an implicit "this->" is added
  4. Add following the first sentence of7.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]) shallbe initialized with a pointer to the object of thecall, converted as if by an explicit type conversion(7.6.3 [expr.cast]). [Note: there is no access checking onthis conversion; the access checking is done as part ofthe (possibly implicit) class member access operator.See 11.8.3 [class.access.base].]
msg8 (view)
Date: 2003-04-25.00:00:00

7.6.1.5 [expr.ref] paragraph 4should makeit clear that when a nonstatic member is referenced in a memberselection operation, the type of the left operand is implicitly castto the naming class of the member. This allows for the detection ofaccess and ambiguity errors on that implicit cast.

History
DateUserActionArgs
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

[8]ページ先頭

©2009-2026 Movatter.jp