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
In C++23, it seemed clear to me that a prvalue constant expression was required to have an object type, because N4950 [expr.const] p13 explicitly listed permitted cases for various object types.
However, after P2686R4, [expr.const] p22 doesn't seem to require object types, and void expressions are arguably accepted. At least, a prvalue of an empty class type and a void prvalue don't seem distinguishable.
Should we clarify the wording to say a prvalue constant expression must have an object type, or, conversely, a void expression can be a prvalue constant expression?
The text was updated successfully, but these errors were encountered:
A "constant expression" is a semantic requirement of the environment where it appears, e.g. in an array bound or similar. In which case would a non-object constant expression be acceptable / required to start with?
In C++23, it seemed clear to me that a prvalue constant expression was required to have an object type, because N4950 [expr.const] p13 explicitly listed permitted cases for various object types.
However, after P2686R4, [expr.const] p22 doesn't seem to require object types, and
void
expressions are arguably accepted. At least, a prvalue of an empty class type and avoid
prvalue don't seem distinguishable.Should we clarify the wording to say a prvalue constant expression must have an object type, or, conversely, a
void
expression can be a prvalue constant expression?The text was updated successfully, but these errors were encountered: