This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: PR 23046. Folding predicates involving TYPE_MAX_VALUE/TYPE_MIN_VALUE (Ada RFC)
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: rth at redhat dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 5 Aug 05 17:16:28 EDT
- Subject: 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.