[Ada] Remove redundant condition for Image attribute and Ada version
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 15 Jan 2021 15:58:41 +0000 (16:58 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 6 May 2021 07:51:24 +0000 (03:51 -0400)
gcc/ada/

* sem_attr.adb (Analyze_Image_Attribute): Remove redundant
condition; add a missing header box.

gcc/ada/sem_attr.adb

index d198bdc..51d2e10 100644 (file)
@@ -1467,6 +1467,10 @@ package body Sem_Attr is
          --  Check that Image_Type is legal as the type of a prefix of 'Image.
          --  Legality depends on the Ada language version.
 
+         ----------------------
+         -- Check_Image_Type --
+         ----------------------
+
          procedure Check_Image_Type (Image_Type : Entity_Id) is
          begin
             --  Image_Type may be empty in case of another error detected,
@@ -1493,7 +1497,7 @@ package body Sem_Attr is
             Set_Etype (N, Str_Typ);
             Check_Image_Type (Etype (P));
 
-            if Attr_Id /= Attribute_Img and then Ada_Version < Ada_2012 then
+            if Attr_Id /= Attribute_Img then
                Error_Msg_Ada_2012_Feature ("|Object''Image", Sloc (P));
             end if;
          else