Created on 1999-09-16.00:00:00 last changed 1 month ago
Change in 7.3.13 [conv.mem] paragraph 2 as follows:
A prvalue of type “pointer to member of B of type cv T”, where B is a class type, can be converted to a prvalue of type “pointer to member of D of type cv T”, where D is a complete class derived (11.7 [class.derived]) from B. If B is an inaccessible (11.8 [class.access]), ambiguous (6.5.2 [class.member.lookup]), or virtual (11.7.2 [class.mi]) base class of D, or a base class of a virtual base class of D, a program that necessitates this conversion is ill-formed.
Theresult of the conversion refers to the same member as the pointer to member before the conversion took place, but it refers to the base class member as if it were a member of the derived class. The result refers to the member in D's instance of B. Since the result has type “pointer to member of D of type cv T”, indirection through it with a D object is valid. The result is the same as if indirecting through the pointer to member of B with the B subobject of D. The null member pointer value is converted to the null member pointer value of the destination type. [ Footnote: ... ]
Change in 184.108.40.206 [expr.static.cast] paragraph 13 as follows:
... If class B contains the original member, or is a base
or derivedclass of the class containing the original member, the resulting pointer to member points to the original member. ...
The second concern is NAD; implicit conversions allow chaining a pointer-to-member conversion with a qualification conversion.
The descriptions of explicit (220.127.116.11 [expr.static.cast] paragraph 9) and implicit (7.3.13 [conv.mem] paragraph 2) pointer-to-member conversions differ in two significant ways:
(This situation cannot arise in an implicit pointer-to-member conversion where the source value is something like &X::f, since you can only implicitly convert from pointer-to-base-member to pointer-to-derived-member. However, if the source value is the result of an explicit "up-cast," the target type of the conversion might still not contain the member referred to by the source value.)
The first difference seems like an oversight. It is not clear whether the latter difference is intentional or not.
(See also issue 794.)
|2023-02-11 23:29:33||admin||set||status: review -> tentatively ready|
|2023-02-11 22:57:01||admin||set||messages: + msg7194|
|2022-11-10 16:58:21||admin||set||messages: + msg7016|
|2022-11-10 16:58:21||admin||set||status: open -> review|
|2022-02-18 07:47:23||admin||set||status: drafting -> open|
|2003-04-25 00:00:00||admin||set||status: open -> drafting|