aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorMarc Poulhiès <poulhies@adacore.com>2023-02-28 17:10:29 +0100
committerMarc Poulhiès <poulhies@adacore.com>2023-05-25 09:44:15 +0200
commitfd694822ca6eda8b08fea10fcabdb0ad508a963e (patch)
treefb0d1c8708474c762bd74f44f1011ee2840cca80 /gcc/ada
parent825cb651135ad9ddb28e047b81ea8a2a6c08a75f (diff)
downloadgcc-fd694822ca6eda8b08fea10fcabdb0ad508a963e.zip
gcc-fd694822ca6eda8b08fea10fcabdb0ad508a963e.tar.gz
gcc-fd694822ca6eda8b08fea10fcabdb0ad508a963e.tar.bz2
ada: Fix incorrect handling of Aggregate aspect
This change fixes 2 incorrect handlings of the aspect. The arguments are now correctly resolved and the aspect is rejected on non array types. gcc/ada/ * sem_ch13.adb (Analyze_One_Aspect): Mark Aggregate aspect as needing delayed resolution and reject the aspect on non-array type.
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/sem_ch13.adb10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index d40c70f..a381972 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -2908,10 +2908,10 @@ package body Sem_Ch13 is
end case;
if Delay_Required
-
and then (A_Id = Aspect_Stable_Properties
or else A_Id = Aspect_Designated_Storage_Model
- or else A_Id = Aspect_Storage_Model_Type)
+ or else A_Id = Aspect_Storage_Model_Type
+ or else A_Id = Aspect_Aggregate)
-- ??? It seems like we should do this for all aspects, not
-- just these, but that causes as-yet-undiagnosed regressions.
@@ -4203,6 +4203,12 @@ package body Sem_Ch13 is
Aitem := Empty;
when Aspect_Aggregate =>
+ if Is_Array_Type (E) then
+ Error_Msg_N
+ ("aspect% can only be applied to non-array type", Id);
+ goto Continue;
+ end if;
+
Validate_Aspect_Aggregate (Expr);
Record_Rep_Item (E, Aspect);
goto Continue;