From: Arnaud Charlet Date: Sun, 13 Dec 2020 17:58:26 +0000 (-0500) Subject: [Ada] Spurious error on 'Image X-Git-Tag: basepoints/gcc-13~8060 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dde4086df2a9c2a1a88bfc02b19dffe2e5b4e87d;p=thirdparty%2Fgcc.git [Ada] Spurious error on 'Image gcc/ada/ * sem_attr.adb (Check_Image_Type): Protect against empty Image_Type. --- diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index e4537e455533..34865f4d1d53 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -1466,7 +1466,11 @@ package body Sem_Attr is procedure Check_Image_Type (Image_Type : Entity_Id) is begin + -- Image_Type may be empty in case of another error detected, + -- or if an N_Raise_xxx_Error node is a parent of N. + if Ada_Version < Ada_2020 + and then Present (Image_Type) and then not Is_Scalar_Type (Image_Type) then Error_Msg_Ada_2020_Feature ("nonscalar ''Image", Sloc (P));