From: squirek Date: Tue, 13 Aug 2024 11:42:41 +0000 (+0000) Subject: ada: Early freezeing of types with 'Size'Class X-Git-Tag: basepoints/gcc-16~5405 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0171938cfc357ed43c2b95ddee504f614cac7982;p=thirdparty%2Fgcc.git 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 --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index e2050e4a9bf..2a48882d83c 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;