diff options
author | Bob Duff <duff@adacore.com> | 2023-03-27 18:07:17 -0400 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-05-26 09:29:19 +0200 |
commit | 53d45e492ebb88a84d6440e7db089d5f78610274 (patch) | |
tree | 8aab9d89ce2967d3af7a22e4fd470bcc35dfe6de /gcc/ada/par-ch4.adb | |
parent | fa4b7069a0dfd28b58c718cf8b2060df47a39641 (diff) | |
download | gcc-53d45e492ebb88a84d6440e7db089d5f78610274.zip gcc-53d45e492ebb88a84d6440e7db089d5f78610274.tar.gz gcc-53d45e492ebb88a84d6440e7db089d5f78610274.tar.bz2 |
ada: Fix crash on 'Img as generic actual function
'Image is allowed as an actual for a generic formal function.
This patch fixes a crash when 'Img is used instead of 'Image
in that context.
Misc cleanups.
gcc/ada/
* exp_put_image.adb (Build_Image_Call): Treat 'Img the same as
'Image.
* exp_imgv.adb (Expand_Image_Attribute): If Discard_Names, expand
to 'Image instead of 'Img.
* snames.ads-tmpl, par-ch4.adb, sem_attr.adb, sem_attr.ads:
Cleanups: Rename Attribute_Class_Array to be Attribute_Set. Remove
unnecessary qualifications. DRY: Don't repeat "True".
Diffstat (limited to 'gcc/ada/par-ch4.adb')
-rw-r--r-- | gcc/ada/par-ch4.adb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb index 2505eb6..52f2b02 100644 --- a/gcc/ada/par-ch4.adb +++ b/gcc/ada/par-ch4.adb @@ -34,17 +34,17 @@ package body Ch4 is -- Attributes that cannot have arguments - Is_Parameterless_Attribute : constant Attribute_Class_Array := - (Attribute_Base => True, - Attribute_Body_Version => True, - Attribute_Class => True, - Attribute_External_Tag => True, - Attribute_Img => True, - Attribute_Loop_Entry => True, - Attribute_Old => True, - Attribute_Result => True, - Attribute_Stub_Type => True, - Attribute_Version => True, + Is_Parameterless_Attribute : constant Attribute_Set := + (Attribute_Base | + Attribute_Body_Version | + Attribute_Class | + Attribute_External_Tag | + Attribute_Img | + Attribute_Loop_Entry | + Attribute_Old | + Attribute_Result | + Attribute_Stub_Type | + Attribute_Version | Attribute_Type_Key => True, others => False); -- This map contains True for parameterless attributes that return a string |