aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_aggr.ads
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2022-08-02 19:46:36 +0200
committerMarc Poulhiès <poulhies@adacore.com>2022-09-05 09:21:07 +0200
commit3424f4c34d04541005ca6d255a04d5f2f613f6b0 (patch)
treeefa54da3d9ff5756360361bbfac72ad039c5a8e5 /gcc/ada/sem_aggr.ads
parent59a23beb9e71a0259b076693dd1e551500c08f24 (diff)
downloadgcc-3424f4c34d04541005ca6d255a04d5f2f613f6b0.zip
gcc-3424f4c34d04541005ca6d255a04d5f2f613f6b0.tar.gz
gcc-3424f4c34d04541005ca6d255a04d5f2f613f6b0.tar.bz2
[Ada] Move check for null array aggregates to expansion
Despite recent changes to runtime checks for null array aggregates, GNATprove still struggles with N_Raise_Constraint_Error nodes inserted into AST by aggregate resolution. The ultimate fix is to move these checks to expansion (which is disabled in GNATprove mode) and explicitly emit a proof check in the GNATprove backend. gcc/ada/ * exp_aggr.adb (Check_Bounds): Move code and comment related to check for null array aggregate from Resolve_Null_Array_Aggregate. * sem_aggr.ads (Is_Null_Aggregate): Move spec from unit body. * sem_aggr.adb (Resolve_Null_Array_Aggregate): Move check to expansion.
Diffstat (limited to 'gcc/ada/sem_aggr.ads')
-rw-r--r--gcc/ada/sem_aggr.ads4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/ada/sem_aggr.ads b/gcc/ada/sem_aggr.ads
index 75af8f7..0d305a8 100644
--- a/gcc/ada/sem_aggr.ads
+++ b/gcc/ada/sem_aggr.ads
@@ -43,6 +43,10 @@ package Sem_Aggr is
-- WARNING: There is a matching C declaration of this subprogram in fe.h
+ function Is_Null_Aggregate (N : Node_Id) return Boolean;
+ -- Returns True for a "[]" aggregate (an Ada 2022 feature), even after
+ -- it has been transformed by expansion. Returns False otherwise.
+
function Is_Null_Array_Aggregate_High_Bound (N : Node_Id) return Boolean;
-- Returns True for the high bound of a null array aggregate.