]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Add Check_Error_Detected before "raise Bad_Attribute"
authorBob Duff <duff@adacore.com>
Fri, 6 Jan 2023 01:21:15 +0000 (20:21 -0500)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 15 May 2023 09:36:41 +0000 (11:36 +0200)
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.

gcc/ada/sem_attr.adb

index 77c56aa587b71597f2fa9c3302b857b982748acc..9de9884069e9dac64535ed1d830c4f2440001f47 100644 (file)
@@ -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;