PR 23046. Folding predicates involving TYPE_MAX_VALUE/TYPE_MIN_VALUE (Ada RFC)
Richard Kenner
kenner@vlsi1.ultra.nyu.edu
Fri Aug 5 21:13:00 GMT 2005
Well, perhaps yes, perhaps no. What I don't know is if it is
actively illegal to assign 0 to an enumeration that doesn't
contain 0 as a member.
It's not "illegal", but there's no way to do it in the language without using
an Unchecked_Conversion (or similar sorts of punning). And if the
Unchecked_Conversion produced a result that did not correspond to the value
of an enumeration literal, the only non-erroneous use of that value is as the
operand of 'Valid.
More information about the Gcc
mailing list