diff options
author | Etienne Servais <servais@adacore.com> | 2022-01-04 12:41:02 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-01-11 13:24:47 +0000 |
commit | f5eb70c2276e94991b453ec07f50e00c5e7dbd36 (patch) | |
tree | f47473c095d2efc64d14098773d448fe9172122b /gcc | |
parent | 303bd2a8428b75f2467578a933e729d5672789d1 (diff) | |
download | gcc-f5eb70c2276e94991b453ec07f50e00c5e7dbd36.zip gcc-f5eb70c2276e94991b453ec07f50e00c5e7dbd36.tar.gz gcc-f5eb70c2276e94991b453ec07f50e00c5e7dbd36.tar.bz2 |
[Ada] Fix check for implicit allocation of dynamic objects
gcc/ada/
* sem_ch3.adb (Check_Dynamic_Object): Swap check order.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_ch3.adb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 3fc2051..06b8cc4 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -3831,6 +3831,9 @@ package body Sem_Ch3 is then null; + elsif Is_Record_Type (Etype (Comp)) then + Check_Dynamic_Object (Etype (Comp)); + elsif not Discriminated_Size (Comp) and then Comes_From_Source (Comp) then @@ -3838,8 +3841,6 @@ package body Sem_Ch3 is ("component& of non-static size will violate restriction " & "No_Implicit_Heap_Allocation?", N, Comp); - elsif Is_Record_Type (Etype (Comp)) then - Check_Dynamic_Object (Etype (Comp)); end if; Next_Component (Comp); |