[Ada] Fix tree for expanded instantiations corresponding to formal packages
authorArnaud Charlet <charlet@adacore.com>
Mon, 2 Nov 2020 11:21:45 +0000 (06:21 -0500)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 27 Nov 2020 09:15:43 +0000 (04:15 -0500)
gcc/ada/

* sem_ch12.adb (Instantiate_Object): Consistently use
New_Copy_Tree instead of New_Copy.

gcc/ada/sem_ch12.adb

index 20a00d7be9e635b7a9f311ea2265cb5464c89a90..6a32bdca1cab63bfd4b7a799d0b668626bb393dd 100644 (file)
@@ -11567,7 +11567,7 @@ package body Sem_Ch12 is
             --  Use default to construct declaration
 
             if Present (Subt_Mark) then
-               Def := New_Copy (Subt_Mark);
+               Def := New_Copy_Tree (Subt_Mark);
             else
                pragma Assert (Present (Acc_Def));
                Def := New_Copy_Tree (Acc_Def);