New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Link in [expr.call]/6 is probably wrong. It should be [expr.reinterpret.cast] instead of [dcl.link]. #2482
Comments
Related: is it intended that calling a |
@jabelloc, [dcl.linik]p1 says "Two function types with different language linkages are distinct types even if they are otherwise identical." So, the cross-reference points at one possible (and not super-obvious) way how you can screw up. |
Done. Apologies for injecting obviously-non-editorial questions in the editorial issue tracker. I should know better. |
Per [basic.link]/11 it's ill-formed NDR to declare the same function with different types. So one already screw up before they invoke that function. |
Editorial meeting:
|
[expr.call]/6:
Calling a function through an expression whose function type is different from the function type of the called function's definition results in undefined behavior ([dcl.link]).
[expr.reinterpret.cast]/6 :
A function pointer can be explicitly converted to a function pointer of a different type. [ Note: The effect of calling a function through a pointer to a function type ([dcl.fct]) that is not the same as the type used in the definition of the function is undefined. — 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. [ Note: See also [conv.ptr] for more details of pointer conversions. — end note ]
The text was updated successfully, but these errors were encountered: