public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Remove redundant condition for Image attribute and Ada version
@ 2021-05-06  7:58 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-05-06  7:58 UTC (permalink / raw)
  To: gcc-patches; +Cc: Piotr Trojanek

[-- Attachment #1: Type: text/plain, Size: 306 bytes --]

Routine Error_Msg_Ada_2012_Feature includes a test on Ada_Version, so
there is no need to explicitly test the same condition just before the
call.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

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

[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 923 bytes --]

diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-06  7:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-06  7:58 [Ada] Remove redundant condition for Image attribute and Ada version Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).