]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Put_Image spec incorrectly ignored for Fixed_Point_Type'Base'Image call.
authorSteve Baird <baird@adacore.com>
Fri, 13 Dec 2024 01:06:00 +0000 (17:06 -0800)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 7 Jan 2025 12:33:32 +0000 (13:33 +0100)
commit67e3db712e36e15486709ea39759a53f15c3d0e6
treeab99e754db12731ba959a82077132058ae51f42c
parentf409c452883011c93a91f8057d301920dbc9bbb2
ada: Put_Image spec incorrectly ignored for Fixed_Point_Type'Base'Image call.

If a Put_Image aspect specification (introduced in Ada 2022) is given for a
fixed point type Fx, then in some cases a call to Fx'Base'Image would
incorrectly ignore the aspect specification and would instead return the
pre-Ada2022 version of the image. However, a call to Fx'Image would do the
right thing.

gcc/ada/ChangeLog:

* exp_put_image.adb (Image_Should_Call_Put_Image): Cope with the case
where the attribute prefix for an Image attribute reference
denotes an Itype constructed for a fixed point type. Calling
Has_Aspect with such an Itype misses applicable aspect
specifications; we need to look on the right list. This comes up
if the prefix of the attribute reference is
Some_Fixed_Point_Type'Base.
gcc/ada/exp_put_image.adb