("class-wide allocator not allowed for this access type", N);
end if;
- Resolve (Expression (E), Etype (E));
- Check_Non_Static_Context (Expression (E));
+ -- Do a full resolution to apply constraint and predicate checks
+
+ Resolve_Qualified_Expression (E, Etype (E));
Check_Unset_Reference (Expression (E));
-- Allocators generated by the build-in-place expansion mechanism
end if;
end if;
- -- A qualified expression requires an exact match of the type. Class-
- -- wide matching is not allowed.
-
- if (Is_Class_Wide_Type (Etype (Expression (E)))
- or else Is_Class_Wide_Type (Etype (E)))
- and then Base_Type (Etype (Expression (E))) /= Base_Type (Etype (E))
- then
- Wrong_Type (Expression (E), Etype (E));
- end if;
-
-- Calls to build-in-place functions are not currently supported in
-- allocators for access types associated with a simple storage pool.
-- Supporting such allocators may require passing additional implicit
if Has_Predicates (Target_Typ) then
Check_Expression_Against_Static_Predicate
- (N, Target_Typ, Static_Failure_Is_Error => True);
+ (Expr, Target_Typ, Static_Failure_Is_Error => True);
end if;
end Resolve_Qualified_Expression;