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);
-
if Nkind (Expression (N)) = N_Raise_Constraint_Error then
Rewrite (N, New_Copy (Expression (N)));
Set_Etype (N, PtrT);
Rewrite (N, New_Occurrence_Of (Temp, Loc));
Analyze_And_Resolve (N, PtrT);
+ Apply_Predicate_Check (N, Dtyp, Deref => True);
+
-- Case of no initialization procedure present
elsif not Has_Non_Null_Base_Init_Proc (T) then
Rewrite (N, New_Occurrence_Of (Temp, Loc));
Analyze_And_Resolve (N, PtrT);
+ Apply_Predicate_Check (N, Dtyp, Deref => True);
+
-- When designated type has Default_Initial_Condition aspects,
-- make a call to the type's DIC procedure to perform the
-- checks. Theoretically this might also be needed for cases
--- /dev/null
+-- { dg-do compile }
+-- { dg-options "-gnata" }
+
+procedure Predicate15 is
+
+ type Grid is array (Positive range <>) of Integer with
+ Dynamic_Predicate => Grid'First = 1;
+
+ type Grid_Ptr is access Grid;
+
+ Data : Grid_Ptr := new Grid (1 .. 10);
+
+begin
+ null;
+end;