https://gcc.gnu.org/bugzilla/show_bug.cgi?id=29463

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Marc Poulhies <[email protected]>:

https://gcc.gnu.org/g:169699428d3c54ccdd56654e1f7b20ea49109d17

commit r16-5236-g169699428d3c54ccdd56654e1f7b20ea49109d17
Author: Eric Botcazou <[email protected]>
Date:   Mon Oct 27 09:18:53 2025 +0100

    ada: Detect illegal value of static expression of decimal fixed point type

    The RM 4.9(36/2) subclause says that, if a static expression is of type
    universal_real and its expected type is a decimal fixed point type, then
    its value shall be a multiple of the small of the decimal type.  This was
    enforced for real literals, but not for real named numbers.

    Fixing the problem involves tweaking Fold_Ureal and the same tweak is also
    applied to Fold_Uint for the sake of consistency in the implementation.

    gcc/ada/ChangeLog:

            PR ada/29463
            * sem_eval.adb (Fold_Uint): Use Universal_Integer as actual type
            for a named number.
            (Fold_Ureal): Likewise with Universal_Real.
            * sem_res.adb (Resolve_Real_Literal): Test whether the literal is
            a static expression instead of coming from source to give the error
            prescribed by the RM 4.9(36/2) subclause.
  • [Bug ada/29463] illegal value o... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to