summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_aggr.adb
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-19 09:03:45 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-19 09:03:45 +0000
commitb11e16d5eacc6bee8aa7ea50be5f2b3f95581b4b (patch)
tree8029b8a046840a43572ac9c006c6c8f55d2b096e /gcc/ada/sem_aggr.adb
parentf0620a215a807d40102f6165c6002a94b4bc283e (diff)
downloadgcc-b11e16d5eacc6bee8aa7ea50be5f2b3f95581b4b.tar.gz
2011-12-19 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 182471 using svnmerge git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@182472 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_aggr.adb')
-rw-r--r--gcc/ada/sem_aggr.adb18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index 011a444cf0d..e70333cc7e6 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -1691,6 +1691,15 @@ package body Sem_Aggr is
end if;
end if;
+ -- If an aggregate component has a type with predicates, an explicit
+ -- predicate check must be applied, as for an assignment statement,
+ -- because the aggegate might not be expanded into individual
+ -- component assignments.
+
+ if Present (Predicate_Function (Component_Typ)) then
+ Apply_Predicate_Check (Expr, Component_Typ);
+ end if;
+
if Raises_Constraint_Error (Expr)
and then Nkind (Parent (Expr)) /= N_Component_Association
then
@@ -3293,6 +3302,15 @@ package body Sem_Aggr is
Aggregate_Constraint_Checks (Expr, Expr_Type);
end if;
+ -- If an aggregate component has a type with predicates, an explicit
+ -- predicate check must be applied, as for an assignment statement,
+ -- because the aggegate might not be expanded into individual
+ -- component assignments.
+
+ if Present (Predicate_Function (Expr_Type)) then
+ Apply_Predicate_Check (Expr, Expr_Type);
+ end if;
+
if Raises_Constraint_Error (Expr) then
Set_Raises_Constraint_Error (N);
end if;