This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 118c. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-10-11


3082. Allow for call-compatible function types in reinterpret_cast

Section: 7.6.1.10  [expr.reinterpret.cast]     Status: tentatively ready     Submitter: US     Date: 2025-10-01

N5028 comment US 30-061

Subclause 7.6.1.10 [expr.reinterpret.cast] paragraph 6 does not, but should, make casts to call-compatible function types predictably valid.

Proposed resolution (approved by CWG 2025-10-10):

Change in 7.6.1.10 [expr.reinterpret.cast] paragraph 6 as follows:

A function pointer can be explicitly converted to a function pointer of a different type. The function pointer value is unchanged by the conversion. [Note 4: The effect of calling a function through a pointer to a function type (9.3.4.6 [dcl.fct]) that is not the same as call-compatible with the type used in the definition of the function is undefined (7.6.1.3 [expr.call]). —end note] Except that converting a prvalue of type “pointer to T1” to the type “pointer to T2” (where T1 and T2 are function types) and back to its original type yields the original pointer value, the result of such a pointer conversion is unspecified.