You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Full name of submitter (unless configured in github; will be published with the issue): Jim X
[expr.const.cast] p9 says
[Note 3: Some conversions which involve only changes in cv-qualification cannot be done using const_cast. For instance, conversions between pointers to functions are not covered because such conversions lead to values whose use causes undefined behavior. For the same reasons, conversions between pointers to member functions, and in particular, the conversion from a pointer to a const member function to a pointer to a non-const member function, are not covered.
— end note]
In general, the note means we forbid the conversion between pointer/reference to function type by using const_cast, however, there is no formal wording.
Suggested Resolution
Give the restriction to T, with the change
The result of the expression const_cast<T>(v) is of type T, T shall not be a pointer/reference to function types.