https://gcc.gnu.org/g:0171938cfc357ed43c2b95ddee504f614cac7982

commit r15-4148-g0171938cfc357ed43c2b95ddee504f614cac7982
Author: squirek <squi...@adacore.com>
Date:   Tue Aug 13 11:42:41 2024 +0000

    ada: Early freezeing of types with 'Size'Class
    
    This patch fixes an issue in the compiler whereby declarations of derived 
types
    whose parent is a mutably tagged type cause early freezing of the parent 
type -
    leading to spurious compile-time errors.
    
    gcc/ada/ChangeLog:
            * sem_ch3.adb (Derived_Type_Declaration): Modify generation of
            compile time check.

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

diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index e2050e4a9bfc..2a48882d83c3 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -17956,8 +17956,8 @@ package body Sem_Ch3 is
                   --  to the backend since we don't know the true size of
                   --  anything at this point.
 
-                  Insert_After_And_Analyze (N,
-                    Make_CW_Size_Compile_Check (T, Root_Class_Typ));
+                  Append_Freeze_Actions (T,
+                    New_List (Make_CW_Size_Compile_Check (T, Root_Class_Typ)));
                end if;
             end if;
          end;

Reply via email to