From: Bob Duff Date: Fri, 6 Jan 2023 01:21:15 +0000 (-0500) Subject: ada: Add Check_Error_Detected before "raise Bad_Attribute" X-Git-Tag: basepoints/gcc-15~9308 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4509d1960165b205425c5b14ef1ff4ea5fd4435;p=thirdparty%2Fgcc.git ada: Add Check_Error_Detected before "raise Bad_Attribute" We shouldn't raise Bad_Attribute if there is no error. This patch adds a call to Check_Error_Detected to make sure that's true. (There are other cases where we raise Bad_Attribute; this patch doesn't try to fix them all.) gcc/ada/ * sem_attr.adb (Analyze_Attribute): Add a call to Check_Error_Detected. --- diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 77c56aa587b7..9de9884069e9 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -3299,6 +3299,7 @@ package body Sem_Attr is -- Check for missing/bad expression (result of previous error) if No (E1) or else Etype (E1) = Any_Type then + Check_Error_Detected; raise Bad_Attribute; end if; end if;