To prevent ambiguities in the use of predefined containers in legacy
code, the resolution of aggregates must ignore the presence of the
Aggregate aspect when the compilation version is earlier than Ada_2020.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* sem_aggr.adb (Resolve_Aggregate): Do not call
Resolve_Container_Aggregate if compilation version is earlier
than Ada_2020.
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -901,6 +901,7 @@ package body Sem_Aggr is
elsif Present (Find_Aspect (Typ, Aspect_Aggregate))
and then Ekind (Typ) /= E_Record_Type
+ and then Ada_Version >= Ada_2020
then
Resolve_Container_Aggregate (N, Typ);