public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-6455] [Ada] Fix check for implicit allocation of dynamic objects
@ 2022-01-11 13:27 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-01-11 13:27 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:f5eb70c2276e94991b453ec07f50e00c5e7dbd36

commit r12-6455-gf5eb70c2276e94991b453ec07f50e00c5e7dbd36
Author: Etienne Servais <servais@adacore.com>
Date:   Tue Jan 4 12:41:02 2022 +0100

    [Ada] Fix check for implicit allocation of dynamic objects
    
    gcc/ada/
    
            * sem_ch3.adb (Check_Dynamic_Object): Swap check order.

Diff:
---
 gcc/ada/sem_ch3.adb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 3fc20512284..06b8cc4a6aa 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);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-11 13:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-11 13:27 [gcc r12-6455] [Ada] Fix check for implicit allocation of dynamic objects Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).