This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR 23046. Folding predicates involving TYPE_MAX_VALUE/TYPE_MIN_VALUE (Ada RFC)


     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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]