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)


* Richard Kenner:

>      No, the language (or, more precisely, GNAT) defines them as 0 and
>      2**size - 1.  Otherwise the 'Valid attribute doesn't work.  Necessary
>      range checks will be optimized away, too.
>
> No, enumeration types are defined as having precisely the set of
> values specifically listed.

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.

If your claim were true, 'Valid could never return False for
enumeration types.


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