PR 23046. Folding predicates involving TYPE_MAX_VALUE/TYPE_MIN_VALUE (Ada RFC)
Richard Kenner
kenner@vlsi1.ultra.nyu.edu
Fri Aug 5 21:11:00 GMT 2005
This is simply not true for Ada. Look at the definition of the 'Valid
attribute in the standard:
3. X'Valid
Yields True if and only if the object denoted by X is normal
and has a valid representation. The value of this attribute
is of the predefined type Boolean.
Right. That says what a "valid representation" is. Except for the
result of an unchecked_conversion being given as the operand of 'Valid,
any other value in that type is erroneous.
If your claim were true, 'Valid could never return False for
enumeration types.
I think you misunderstand what 'Valid is. It tests for objects being *in
the type*. If the type were in fact the full range, then 'Valid would
always return True.
More information about the Gcc
mailing list