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
An expression of integral, enumeration, pointer, or pointer-to-member type can be explicitly converted to its own type; such a cast yields the value of its operand.
What does "its own type" mean? Does it mean the identical original type or something else? Consider this example:
Both GCC and Clang accept this example. I think such a conversion is intended to be regulated by [expr.reinterpret.cast] p2. Because p1 says
Conversions that can be performed explicitly using reinterpret_cast are listed below.No other conversion can be performed explicitly using reinterpret_cast.
Except that p2 might be relevant to this example, all other rules are irrelevant to the above example. It is necessary to clarify what "its own type" means. Presumably, it means
An expression of integral, enumeration, pointer, or pointer-to-member type can be explicitly converted to the cv-unqualified version or cv-qualification of that type.
The text was updated successfully, but these errors were encountered:
It seem better to me to specify that if the target type of an explicit cast expression is a scalar or cvvoid, the top-level cv-qualification is removed first (rather than after the cast). Then only cv-unqualified scalar prvalue will be converted to cv-unqualified target types here, which is perfectly fine.
[expr.reinterpret.cast] p2 says
What does "its own type" mean? Does it mean the identical original type or something else? Consider this example:
Both GCC and Clang accept this example. I think such a conversion is intended to be regulated by [expr.reinterpret.cast] p2. Because p1 says
Except that p2 might be relevant to this example, all other rules are irrelevant to the above example. It is necessary to clarify what "its own type" means. Presumably, it means
The text was updated successfully, but these errors were encountered: