]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Early freezeing of types with 'Size'Class
authorsquirek <squirek@adacore.com>
Tue, 13 Aug 2024 11:42:41 +0000 (11:42 +0000)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 8 Oct 2024 08:37:13 +0000 (10:37 +0200)
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.

gcc/ada/sem_ch3.adb

index e2050e4a9bfc0766a093c1292d9417e706b45d1c..2a48882d83c3282d0e9a2cde9a8e5ce300fd9158 100644 (file)
@@ -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;