[gcc r16-1148] ada: Error about assignment to limited target on aggregate with "for of" iterator
Marc Poulhies
dkm@gcc.gnu.org
Thu Jun 5 08:21:33 GMT 2025
https://gcc.gnu.org/g:69f1d543edeb192a05bac7ff8a07350dbb3d986f
commit r16-1148-g69f1d543edeb192a05bac7ff8a07350dbb3d986f
Author: Gary Dismukes <dismukes@adacore.com>
Date: Sat Jan 18 01:11:12 2025 +0000
ada: Error about assignment to limited target on aggregate with "for of" iterator
The compiler reports a spurious error about an assignment to a limited
object on an aggregate of a array type with limited components that has
an association with a "for of" iterator. This is fixed by arranging to
have the Assignment_OK flag set on the indexed_names generated by the
expander for initializing the aggregate object.
gcc/ada/ChangeLog:
* exp_aggr.adb (Two_Pass_Aggregate_Expansion): Change call to Make_Assignment
for the indexed aggregate object to call Change_Make_OK_Assignment instead.
Diff:
---
gcc/ada/exp_aggr.adb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb
index 7cb26ce1af51..3c4576df3b83 100644
--- a/gcc/ada/exp_aggr.adb
+++ b/gcc/ada/exp_aggr.adb
@@ -5749,7 +5749,7 @@ package body Exp_Aggr is
while Present (Assoc) loop
Iter := Iterator_Specification (Assoc);
Iter_Id := Defining_Identifier (Iter);
- New_Comp := Make_Assignment_Statement (Loc,
+ New_Comp := Make_OK_Assignment_Statement (Loc,
Name =>
Make_Indexed_Component (Loc,
Prefix => New_Occurrence_Of (TmpE, Loc),
More information about the Gcc-cvs
mailing list