From b11e16d5eacc6bee8aa7ea50be5f2b3f95581b4b Mon Sep 17 00:00:00 2001 From: bstarynk Date: Mon, 19 Dec 2011 09:03:45 +0000 Subject: 2011-12-19 Basile Starynkevitch 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 --- gcc/ada/sem_aggr.adb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gcc/ada/sem_aggr.adb') 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; -- cgit v1.2.1