Previous change, "Make pp and friends more robust (base type only)"
introduced a bug in Root_Type. Etype (T) can, in fact, be Empty
(but only in case of errors.) This patch fixes it.
gcc/ada/ChangeLog:
* einfo-utils.adb (Root_Type): Deal with missing Etype.
(Root_Type_If_Set): Likewise.
loop
Etyp := Etype (T);
- exit when T = Etyp
+ if No (Etyp) then
+ Check_Error_Detected;
+ end if;
+
+ exit when No (Etyp) or else T = Etyp
or else
(Is_Private_Type (T) and then Etyp = Full_View (T))
or else
end return;
end Root_Type;
+ ----------------------
+ -- Root_Type_If_Set --
+ ----------------------
+
function Root_Type_If_Set (Id : E) return Opt_N_Entity_Id is
Etyp : Entity_Id;
loop
Etyp := Etype (T);
- if No (Etyp) then
- T := Empty;
- exit;
- end if;
-
- exit when T = Etyp
+ exit when No (Etyp) or else T = Etyp
or else
(Is_Private_Type (T) and then Etyp = Full_View (T))
or else