aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2025-03-20 23:29:33 +0100
committerEric Botcazou <ebotcazou@adacore.com>2025-06-10 10:58:37 +0200
commit8a4b72a2d99918d6bc315f2664a22457b9848ce7 (patch)
treedfd0853f5bb0c033492109e617dabac4f67f1d1a
parent2859883e8901f5db7b26c07f823e2e8bc531a70d (diff)
downloadgcc-8a4b72a2d99918d6bc315f2664a22457b9848ce7.zip
gcc-8a4b72a2d99918d6bc315f2664a22457b9848ce7.tar.gz
gcc-8a4b72a2d99918d6bc315f2664a22457b9848ce7.tar.bz2
ada: Fix infinite loop with aggregate in generic unit
Root_Type does not return the same type for the private and the full view of a derived private tagged type when both derive from an interface type. gcc/ada/ChangeLog: * sem_ch12.adb (Copy_Generic_Node): Do not call Root_Type to find the root type of an aggregate of a derived tagged type.
-rw-r--r--gcc/ada/sem_ch12.adb5
1 files changed, 1 insertions, 4 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index d93788b7..02c7c36 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -9340,9 +9340,6 @@ package body Sem_Ch12 is
and then Nkind (Ancestor_Type (N)) in N_Entity
then
declare
- Root_Typ : constant Entity_Id :=
- Root_Type (Ancestor_Type (N));
-
Typ : Entity_Id := Ancestor_Type (N);
begin
@@ -9351,7 +9348,7 @@ package body Sem_Ch12 is
Switch_View (Typ);
end if;
- exit when Typ = Root_Typ;
+ exit when Etype (Typ) = Typ;
Typ := Etype (Typ);
end loop;