aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Baird <baird@adacore.com>2022-11-29 14:32:07 -0800
committerMarc Poulhiès <poulhies@adacore.com>2022-12-01 14:53:54 +0100
commit82cf82c4610dbf2a1021841fea3700a477246b79 (patch)
tree7a37b76177e7f903090ac0d48f25c071d928bd98
parentf82d10a5485965788dad8258e8946c34d90953a0 (diff)
downloadgcc-82cf82c4610dbf2a1021841fea3700a477246b79.zip
gcc-82cf82c4610dbf2a1021841fea3700a477246b79.tar.gz
gcc-82cf82c4610dbf2a1021841fea3700a477246b79.tar.bz2
ada: Enforce Aggregate aspect legality rule
Ada 2022 requires that an Aggregate aspect specification shall specify a a name for at least one of Add_Named, Add_Unnamed, or Assign_Indexed. Enforce this rule. gcc/ada/ * sem_ch13.adb (Validate_Aspect_Aggregate): Reject illegal case where none of Add_Named, Add_Unnamed, and Assign_Indexed are specified.
-rw-r--r--gcc/ada/sem_ch13.adb6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index a478274..71eabb4 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -15729,6 +15729,12 @@ package body Sem_Ch13 is
return;
end if;
+ elsif No (Add_Named_Subp)
+ and then No (Add_Unnamed_Subp)
+ and then No (Assign_Indexed_Subp)
+ then
+ Error_Msg_N ("incomplete specification for aggregate", N);
+
elsif Present (New_Indexed_Subp) /= Present (Assign_Indexed_Subp) then
Error_Msg_N ("incomplete specification for indexed aggregate", N);
end if;