[gcc r16-1307] ada: Tweak Kill_Current_Values
Marc Poulhies
dkm@gcc.gnu.org
Mon Jun 9 06:38:27 GMT 2025
https://gcc.gnu.org/g:acc54e0cf014b01b4e8b2579002729316fe93834
commit r16-1307-gacc54e0cf014b01b4e8b2579002729316fe93834
Author: Ronan Desplanques <desplanques@adacore.com>
Date: Thu Feb 27 11:25:45 2025 +0100
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:
---
gcc/ada/sem_util.adb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 0ce9e95a6206..02ebb71b562c 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);
More information about the Gcc-cvs
mailing list