Error_Msg_N ("?use of an anonymous access type allocator", N);
end if;
- -- RM E.2.3(22). We enforce that the expected type of an allocator
+ -- RM E.2.2(17). We enforce that the expected type of an allocator
-- shall not be a remote access-to-class-wide-limited-private type
-- Why is this being done at expansion time, seems clearly wrong ???
-- Validate_Remote_Access_To_Class_Wide_Type for attribute
-- Storage_Pool since this attribute is not defined for such
- -- types (RM E.2.3(22)).
+ -- types (RM E.2.2(17)).
Validate_Remote_Access_To_Class_Wide_Type (N);
Check_Type;
Set_Etype (N, Universal_Integer);
- -- Validate_Remote_Access_To_Class_Wide_Type for attribute
- -- Storage_Size since this attribute is not defined for
- -- such types (RM E.2.3(22)).
+ -- Validate_Remote_Access_To_Class_Wide_Type for attribute
+ -- Storage_Size since this attribute is not defined for
+ -- such types (RM E.2.2(17)).
Validate_Remote_Access_To_Class_Wide_Type (N);
-- 4. called from sem_res Resolve_Actuals
- if K = N_Attribute_Reference then
+ if K = N_Attribute_Definition_Clause then
+ E := Etype (Entity (N));
+
+ if Is_Remote_Access_To_Class_Wide_Type (E) then
+ Error_Msg_Name_1 := Chars (N);
+ Error_Msg_N
+ ("cannot specify% aspect for a remote operand", N);
+ return;
+ end if;
+
+ elsif K = N_Attribute_Reference then
E := Etype (Prefix (N));
if Is_Remote_Access_To_Class_Wide_Type (E) then
-- Checks that Storage_Pool and Storage_Size attribute references are
-- not applied to remote access-to-class-wide types. Also checks that the
-- expected type for an allocator cannot be a remote access-to-class-wide
- -- type. ALso checks that a remote access-to-class-wide type cannot be an
- -- actual parameter for a generic formal access type. RM E.2.3(22).
+ -- type. Also checks that a remote access-to-class-wide type cannot be an
+ -- actual parameter for a generic formal access type. RM E.2.2(17).
procedure Validate_RT_RAT_Component (N : Node_Id);
-- Given N, the package library unit declaration node, we should check
with Sem; use Sem;
with Sem_Aux; use Sem_Aux;
with Sem_Case; use Sem_Case;
+with Sem_Cat; use Sem_Cat;
with Sem_Ch3; use Sem_Ch3;
with Sem_Ch6; use Sem_Ch6;
with Sem_Ch7; use Sem_Ch7;
return;
end if;
+ -- Validate_Remote_Access_To_Class_Wide_Type for attribute
+ -- Storage_Pool since this attribute cannot be defined for such
+ -- types (RM E.2.2(17)).
+
+ Validate_Remote_Access_To_Class_Wide_Type (N);
+
-- If the argument is a name that is not an entity name, then
-- we construct a renaming operation to define an entity of
-- type storage pool.
null;
else
+ -- Validate_Remote_Access_To_Class_Wide_Type for attribute
+ -- Storage_Size since this attribute cannot be defined for such
+ -- types (RM E.2.2(17)).
+
+ Validate_Remote_Access_To_Class_Wide_Type (N);
+
Analyze_And_Resolve (Expr, Any_Integer);
if Is_Access_Type (U_Ent) then