The result returned by the predicate may change depending on whether an
error was posted on the type, which complicates further error reporting.

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

gcc/ada/

        * sem_aux.adb (Is_By_Reference_Type): Do not test Error_Posted.
diff --git a/gcc/ada/sem_aux.adb b/gcc/ada/sem_aux.adb
--- a/gcc/ada/sem_aux.adb
+++ b/gcc/ada/sem_aux.adb
@@ -846,10 +846,7 @@ package body Sem_Aux is
       Btype : constant Entity_Id := Base_Type (Ent);
 
    begin
-      if Error_Posted (Ent) or else Error_Posted (Btype) then
-         return False;
-
-      elsif Is_Private_Type (Btype) then
+      if Is_Private_Type (Btype) then
          declare
             Utyp : constant Entity_Id := Underlying_Type (Btype);
          begin


Reply via email to