Title
Converting pointer to incomplete type to same type
Status
nad
Section
6.3 [basic.def.odr]
Submitter
Steve Adamczyk

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

Messages

Date: 1999-04-15.00:00:00

Rationale (04/99): The relevant normative text makes this clear. Implicit conversion and static_cast are defined (in 7.3 [conv] and 7.6.1.9 [expr.static.cast] , respectively) as equivalent to declaration with initialization, which permits pointers to incomplete types, and dynamic_cast (7.6.1.7 [expr.dynamic.cast] ) explicitly prohibits pointers to incomplete types.

Date: 2022-09-25.18:08:42

In 6.3 [basic.def.odr] paragraph 4 bullet 4, it's presumably the case that a conversion to T* requires that T be complete only if the conversion is from a different type. One could argue that there is no conversion (and therefore the text is accurate as it stands) if a cast does not change the type of the expression, but it's probably better to be more explicit here.

On the other hand, this text is non-normative (it's in a note).

Rationale (04/99): The relevant normative text makes this clear. Implicit conversion and static_cast are defined (in 7.3 [conv] and 7.6.1.9 [expr.static.cast] , respectively) as equivalent to declaration with initialization, which permits pointers to incomplete types, and dynamic_cast (7.6.1.7 [expr.dynamic.cast] ) explicitly prohibits pointers to incomplete types.

History
Date User Action Args
1999-09-14 00:00:00adminsetmessages: + msg185
1999-09-14 00:00:00adminsetstatus: open -> nad
1998-10-13 00:00:00admincreate