and then
No (Discriminant_Default_Value (First_Discriminant (T)))
and then not Known_RM_Size (T)
+ and then not Known_Esize (T)
then
return False;
end if;
-- RM_Size field is set to the required size, allowing for possible front
-- end packing of an array using this type as a component type.
--
- -- Note: the flag Size_Known_At_Compile_Time is used to determine if the
- -- secondary stack must be used to return a value of the type, and also
- -- to determine whether a component clause is allowed for a component
- -- of the given type.
- --
- -- Note: this is public because of one dubious use in Sem_Res???
+ -- Note: the flag Size_Known_At_Compile_Time is used to determine whether a
+ -- size clause is allowed for the type, and also whether a component clause
+ -- is allowed for a component of the type.
--
-- Note: Check_Compile_Time_Size does not test the case of the size being
-- known because a size clause is specifically given. That is because we
-- do not allow a size clause if the size would not otherwise be known at
-- compile time in any case.
+ --
+ -- ??? This is public because of dubious uses in Sem_Ch3 and Sem_Res
procedure Check_Inherited_Conditions
(R : Entity_Id;
return False;
end Depends_On_Discriminant;
+ -- Start of processing for Caller_Known_Size_Record
+
begin
-- This is a protected type without Corresponding_Record_Type set,
-- typically because expansion is disabled. The safe thing to do is
return True;
end if;
+ -- If either size is specified for the type, then it's known in the
+ -- caller in particular. Note that, even if the clause is confirming,
+ -- this does not change the outcome since the size was already known.
+
+ if Has_Size_Clause (First_Subtype (Typ))
+ or else Has_Object_Size_Clause (First_Subtype (Typ))
+ then
+ return True;
+ end if;
+
-- First see if we have a variant part and return False if it depends
-- on discriminants.