ada: Compile-time simplification of 'Image incorrectly ignores Put_Image
authorSteve Baird <baird@adacore.com>
Tue, 25 Oct 2022 23:59:29 +0000 (16:59 -0700)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 8 Nov 2022 08:35:03 +0000 (09:35 +0100)
commit10f193eb043e30741d9631999bc869d71d43264c
tree7b5c5520a97d7a735d6fca41fc20a6bcf46590a8
parent11f892571c7ab4964f16c0d432e6f5a9b4a091f1
ada: Compile-time simplification of 'Image incorrectly ignores Put_Image

In the case of Some_Enumeration_Type'Image (<some static value>),
the compiler will replace this expression in its internal program
representation with a corresponding string literal. This is incorrect
if the Put_Image aspect has been specified (directly or via inheritance)
for the enumeration type.

gcc/ada/

* sem_attr.adb
(Eval_Attribute): Don't simplify 'Image call if Put_Image has been
specified.
gcc/ada/sem_attr.adb