From: Ronan Desplanques Date: Thu, 27 Feb 2025 10:25:45 +0000 (+0100) Subject: ada: Tweak Kill_Current_Values X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=acc54e0cf014b01b4e8b2579002729316fe93834;p=thirdparty%2Fgcc.git ada: Tweak Kill_Current_Values Is_Object returns True for "record field" entities, which might make sense in some contexts but not when Kill_Current_Values is called in a default expression of a record component. This patch refines the choice of considered entities in Kill_Current_Values accordingly. gcc/ada/ChangeLog: * sem_util.adb (Kill_Current_Values): Tweak condition. --- diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 0ce9e95a620..02ebb71b562 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -21907,7 +21907,7 @@ package body Sem_Util is Set_Last_Assignment (Ent, Empty); end if; - if Is_Object (Ent) then + if Is_Object (Ent) and then Ekind (Ent) not in Record_Field_Kind then if not Last_Assignment_Only then Kill_Checks (Ent); Set_Current_Value (Ent, Empty);