diff options
author | Javier Miranda <miranda@adacore.com> | 2021-12-20 11:51:44 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-01-07 16:24:12 +0000 |
commit | e2b07ba054daa896795e0932626f259c87417ec0 (patch) | |
tree | 84b1429e77f245558715b3be11083cabd781f162 | |
parent | 20f6d5e4a8862f733e66f57ac9f2f2792903ac61 (diff) | |
download | gcc-e2b07ba054daa896795e0932626f259c87417ec0.zip gcc-e2b07ba054daa896795e0932626f259c87417ec0.tar.gz gcc-e2b07ba054daa896795e0932626f259c87417ec0.tar.bz2 |
[Ada] Spurious error caused by order of interfaces in full view
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).
-rw-r--r-- | gcc/ada/sem_ch3.adb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index ce5f453..bd51c5b 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -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 |