]> gcc.gnu.org Git - gcc.git/commitdiff
[Ada] Spurious error caused by order of interfaces in full view
authorJavier Miranda <miranda@adacore.com>
Mon, 20 Dec 2021 11:51:44 +0000 (11:51 +0000)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 7 Jan 2022 16:24:12 +0000 (16:24 +0000)
gcc/ada/

* sem_ch3.adb (Reorder_Interfaces): When the conflicting
interface is identified we just replace the interface in the
list of interfaces of the tagged type (instead of adding a
duplicate to the list of interfaces).

gcc/ada/sem_ch3.adb

index ce5f4536a26365be77d9b8cc823c81832f60afa6..bd51c5b3337bc39c3e611e4421d210c8473e0e0c 100644 (file)
@@ -17272,7 +17272,6 @@ package body Sem_Ch3 is
             --  append the full view's original parent to the interface list,
             --  recursively call Derived_Type_Definition on the full type, and
             --  return True. If a match is not found, return False.
-            --  ??? This seems broken in the case of generic packages.
 
             ------------------------
             -- Reorder_Interfaces --
@@ -17281,6 +17280,7 @@ package body Sem_Ch3 is
             function Reorder_Interfaces return Boolean is
                Iface     : Node_Id;
                New_Iface : Node_Id;
+
             begin
                Iface := First (Interface_List (Def));
                while Present (Iface) loop
@@ -17290,7 +17290,7 @@ package body Sem_Ch3 is
 
                      New_Iface :=
                        Make_Identifier (Sloc (N), Chars (Parent_Type));
-                     Append (New_Iface, Interface_List (Def));
+                     Rewrite (Iface, New_Iface);
 
                      --  Analyze the transformed code
 
This page took 0.082959 seconds and 5 git commands to generate.