diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2021-10-14 12:48:12 +0200 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2022-11-08 09:34:57 +0100 |
commit | 4a22fdac0f6e79478768e6792c9804816ecb3f4a (patch) | |
tree | da119df0f195d884d466cb57faf61fe1614f8a8c /gcc/ada/sem_aggr.adb | |
parent | b9d8ad7175359f7a6dfd803fcc3b3f619301e734 (diff) | |
download | gcc-4a22fdac0f6e79478768e6792c9804816ecb3f4a.zip gcc-4a22fdac0f6e79478768e6792c9804816ecb3f4a.tar.gz gcc-4a22fdac0f6e79478768e6792c9804816ecb3f4a.tar.bz2 |
ada: Reject record delta aggregates with limited expressions
Implement a missing check related to record delta aggregates.
gcc/ada/
* sem_aggr.adb (Resolve_Delta_Record_Aggregate): Reject
expressions of a limited types.
Diffstat (limited to 'gcc/ada/sem_aggr.adb')
-rw-r--r-- | gcc/ada/sem_aggr.adb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 31ce9ca..383f18f 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -3746,7 +3746,17 @@ package body Sem_Aggr is ("'<'> in record delta aggregate is not allowed", Assoc); else Analyze_And_Resolve (Expression (Assoc), Comp_Type); + + -- The expression must not be of a limited type; RM 4.3.1(17.4/5) + + if Is_Limited_Type (Etype (Expression (Assoc))) then + Error_Msg_N + ("expression of a limited type in record delta aggregate " & + "is not allowed", + Expression (Assoc)); + end if; end if; + Next (Assoc); end loop; end Resolve_Delta_Record_Aggregate; |