if Is_Itype (Typ) then
Set_Parent (Decl, Associated_Node_For_Itype (Typ));
+ Set_Associated_Node_For_Itype
+ (PAT, Associated_Node_For_Itype (Typ));
else
Set_Parent (Decl, Declaration_Node (Typ));
+ Set_Associated_Node_For_Itype
+ (PAT, Declaration_Node (Typ));
end if;
if Scope (Typ) /= Current_Scope then
-- When this routine is called while the itype
-- is being created, the entity might not yet be
- -- decorated with the associated node, but should
+ -- decorated with the associated node, but will
-- have the related expression.
if Present (Associated_Node_For_Itype (Subt)) then
Possible_Side_Effect_In_SPARK
(Associated_Node_For_Itype (Subt));
- elsif Present (Related_Expression (Subt)) then
+ else
return
Possible_Side_Effect_In_SPARK
(Related_Expression (Subt));
-
- -- When the itype doesn't have any indication of its
- -- origin (which currently only happens for packed
- -- array types created by freezing that shouldn't
- -- be picked by GNATprove anyway), then we can
- -- conservatively assume that the expression can
- -- be kept as it appears in the source code.
-
- else
- pragma Assert (Is_Packed_Array_Impl_Type (Subt));
- return False;
end if;
else
return True;