gcc/ada/
* exp_ch4.adb (Expand_N_Allocator): In the subtype mark case, do
not apply constraint checks if the No_Initialization flag is set.
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);