type Kind_Test is access function (E : Entity_Id) return Boolean;
function Is_Definite_Access_Type (E : Entity_Id) return Boolean;
- -- Determine whether E is an acess type declared by an access decla-
+ -- Determine whether E is an access type declared by an access decla-
-- ration, and not an (anonymous) allocator type.
function Operand_Type_In_Scope (S : Entity_Id) return Boolean;
-- If we are taking the reference of a volatile entity, then treat
-- it as a potential modification of this entity. This is much too
- -- conservative, but is neccessary because remove side effects can
+ -- conservative, but is necessary because remove side effects can
-- result in transformations of normal assignments into reference
-- sequences that otherwise fail to notice the modification.
It1 : Interp;
Found : Boolean;
+ function Init_Component return Boolean;
+ -- Check whether this is the initialization of a component within an
+ -- init_proc (by assignment or call to another init_proc). If true,
+ -- there is no need for a discriminant check.
+
+ --------------------
+ -- Init_Component --
+ --------------------
+
+ function Init_Component return Boolean is
+ begin
+ return Inside_Init_Proc
+ and then Nkind (Prefix (N)) = N_Identifier
+ and then Chars (Prefix (N)) = Name_uInit
+ and then Nkind (Parent (Parent (N))) = N_Case_Statement_Alternative;
+ end Init_Component;
+
+ -- Start of processing for Resolve_Selected_Component
+
begin
if Is_Overloaded (P) then
and then Present (Discriminant_Checking_Func
(Original_Record_Component (Entity (S))))
and then not Discriminant_Checks_Suppressed (T)
+ and then not Init_Component
then
Set_Do_Discriminant_Check (N);
end if;