aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_attr.adb
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2020-06-13 12:38:00 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2020-07-27 04:05:19 -0400
commit2d4fe2035920a2440ca2d787cefc6eca03a4af40 (patch)
tree1ea85f0e52ac3d422dbdd87c9e9f575622a25ad4 /gcc/ada/sem_attr.adb
parent21717db17a8264b7f75366aafa3d21afce5dd41b (diff)
downloadgcc-2d4fe2035920a2440ca2d787cefc6eca03a4af40.zip
gcc-2d4fe2035920a2440ca2d787cefc6eca03a4af40.tar.gz
gcc-2d4fe2035920a2440ca2d787cefc6eca03a4af40.tar.bz2
[Ada] Ada2020: wording of 'Image messages
gcc/ada/ * errout.ads, errout.adb (Error_Msg_Ada_2020_Feature): New procedure analogous to Error_Msg_Ada_2012_Feature. * sem_attr.adb (Analyze_Image_Attribute): Use Error_Msg_Ada_2012_Feature and Error_Msg_Ada_2020_Feature to indicate that Object'Image is allowed in Ada 2012, and that 'Image is allowed for any type in Ada 2020.
Diffstat (limited to 'gcc/ada/sem_attr.adb')
-rw-r--r--gcc/ada/sem_attr.adb17
1 files changed, 6 insertions, 11 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index b35f2b6..e3c027d 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -1457,16 +1457,11 @@ package body Sem_Attr is
procedure Check_Image_Type (Image_Type : Entity_Id) is
begin
- if Ada_Version >= Ada_2020 then
- null; -- all types are OK
- elsif not Is_Scalar_Type (Image_Type) then
- if Ada_Version >= Ada_2012 then
- Error_Attr_P
- ("prefix of % attribute must be a scalar type or a scalar "
- & "object name");
- else
- Error_Attr_P ("prefix of % attribute must be a scalar type");
- end if;
+ if Ada_Version < Ada_2020
+ and then not Is_Scalar_Type (Image_Type)
+ then
+ Error_Msg_Ada_2020_Feature ("|nonscalar ''Image", Sloc (P));
+ Error_Attr;
end if;
end Check_Image_Type;
@@ -1483,7 +1478,7 @@ package body Sem_Attr is
Check_Image_Type (Etype (P));
if Attr_Id /= Attribute_Img and then Ada_Version < Ada_2012 then
- Error_Attr_P ("prefix of % attribute must be a scalar type");
+ Error_Msg_Ada_2012_Feature ("|Object''Image", Sloc (P));
end if;
else
Check_E1;