aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSteve Baird <baird@adacore.com>2022-10-11 15:21:39 -0700
committerMarc Poulhiès <poulhies@adacore.com>2022-11-07 09:36:31 +0100
commit748976cfc867cb387f0f8180c48233e883223f93 (patch)
tree0a65d7ceb3c4e4394062131d6a2d5b837128514f /gcc
parentae3952715ce92cb6baac6d2b883c9a29a70cb1d9 (diff)
downloadgcc-748976cfc867cb387f0f8180c48233e883223f93.zip
gcc-748976cfc867cb387f0f8180c48233e883223f93.tar.gz
gcc-748976cfc867cb387f0f8180c48233e883223f93.tar.bz2
ada: Put_Image aspect spec incorrectly not inherited
In some cases, a Put_Image aspect specification for a scalar type was not correctly inherited by a descendant of that type. gcc/ada/ * exp_put_image.adb (Image_Should_Call_Put_Image): Correctly handle the case of an inherited Put_Image aspect specification for a scalar type.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/exp_put_image.adb6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/ada/exp_put_image.adb b/gcc/ada/exp_put_image.adb
index 50e0569..c489ad4 100644
--- a/gcc/ada/exp_put_image.adb
+++ b/gcc/ada/exp_put_image.adb
@@ -1039,13 +1039,13 @@ package body Exp_Put_Image is
end if;
-- In Ada 2022, T'Image calls T'Put_Image if there is an explicit
- -- aspect_specification for Put_Image, or if U_Type'Image is illegal
- -- in pre-2022 versions of Ada.
+ -- (or inherited) aspect_specification for Put_Image, or if
+ -- U_Type'Image is illegal in pre-2022 versions of Ada.
declare
U_Type : constant Entity_Id := Underlying_Type (Entity (Prefix (N)));
begin
- if Present (TSS (U_Type, TSS_Put_Image)) then
+ if Present (Find_Aspect (U_Type, Aspect_Put_Image)) then
return True;
end if;