This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 119a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-12-20
[Accepted as a DR at the February, 2019 meeting.]
The specification of derived-to-base pointer conversions in7.3.12 [conv.ptr] paragraph 3 does not require that the derivedclass be complete at the point of the conversion. This leaves unclear thestatus of an example like the following, on which there is implementationdivergence:
template<typename A, typename B> struct check_derived_from { static A a; static constexpr B *p = &a; }; struct W {}; struct X {}; struct Y {}; struct Z : W, X, check_derived_from<Z, X>, // #1 check_derived_from<Z, Y>, Y { // #2 check_derived_from<Z, W> cdf; // #3 };Notes from the March, 2018 meeting:
The consensus of CWG was that the derived class must be complete atthe point of the conversion, and thus all three attempted conversions inthe example are ill-formed.
Proposed resolution (November, 2018):
Change 7.3.12 [conv.ptr] paragraph 3 as follows:
A prvalue of type “pointer tocvD”, whereD is acompleteclass type, can be converted to a prvalue of type“pointer tocvB”, whereB is a base class(11.7 [class.derived]) ofD. IfB isan inaccessible...
Change 7.3.13 [conv.mem] paragraph 2 as follows:
A prvalue of type “pointer to member ofB oftypecvT”, where B is aclass type, can be converted to a prvalue of type“pointer to member ofD of typecvT”, whereDis acomplete classderivedclass(11.7 [class.derived])offromB. IfBis an inaccessible...
Change 7.6.1.9 [expr.static.cast] paragraphs 11 and 12 asfollowed:
A prvalue of type “pointer tocv1B”, whereBis acompleteclass type, can be converted to a prvalue of type“pointer tocv2D”, where D is a class derived(11.7 [class.derived]) from B , if cv2 is the same...
A prvalue of type “pointer to member ofDof typecv1T” can be converted to a prvalue of type“pointer to member ofBof typecv2T”, whereBis a base class (11.7 [class.derived]) ofa complete classD, ifcv2is the same...