aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2020-08-05 15:50:06 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-10-21 03:22:50 -0400
commit4cd2e6f249e55c810c0414572807face97d88f07 (patch)
treeb2818db1f42d9ab0b0d315d7dea1873f5f796689 /gcc
parent3d3378fbb2f0183d0b6bfc41187c941dc57f7dcc (diff)
downloadgcc-4cd2e6f249e55c810c0414572807face97d88f07.zip
gcc-4cd2e6f249e55c810c0414572807face97d88f07.tar.gz
gcc-4cd2e6f249e55c810c0414572807face97d88f07.tar.bz2
[Ada] Fix problematic placement of freeze node after instantiation
gcc/ada/ * sem_ch12.adb (Freeze_Subprogram_Body): Do not move the freeze node of the package body enclosing the instance when its parent is in the same declarative part as the freeze node of the parent.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_ch12.adb7
1 files changed, 1 insertions, 6 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 64f10a2..16b42bd 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -9106,12 +9106,7 @@ package body Sem_Ch12 is
and then Present (Freeze_Node (Par))
and then Present (Enc_I)
then
- if In_Same_Declarative_Part (Parent (Freeze_Node (Par)), Enc_I)
- or else
- (Nkind (Enc_I) = N_Package_Body
- and then In_Same_Declarative_Part
- (Parent (Freeze_Node (Par)), Parent (Enc_I)))
- then
+ if In_Same_Declarative_Part (Parent (Freeze_Node (Par)), Enc_I) then
-- The enclosing package may contain several instances. Rather
-- than computing the earliest point at which to insert its freeze
-- node, we place it at the end of the declarative part of the