aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ada/exp_ch4.adb5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index b40864f..cd71075 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -4847,10 +4847,11 @@ package body Exp_Ch4 is
Temp_Type : Entity_Id;
begin
- -- Apply constraint checks against designated subtype (RM 4.8(10/2)).
+ -- Apply constraint checks against designated subtype (RM 4.8(10/2))
+ -- but ignore the expression if the No_Initialization flag is set.
-- Discriminant checks will be generated by the expansion below.
- if Is_Array_Type (Dtyp) then
+ if Is_Array_Type (Dtyp) and then not No_Initialization (N) then
Apply_Constraint_Check (Expression (N), Dtyp, No_Sliding => True);
Apply_Predicate_Check (Expression (N), Dtyp);