-- --
-- B o d y --
-- --
--- $Revision: 1.717 $
+-- $Revision$
-- --
-- Copyright (C) 1992-2001, Free Software Foundation, Inc. --
-- --
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;
-- Start of processing for Resolve
begin
+ if N = Error then
+ return;
+ end if;
+
-- Access attribute on remote subprogram cannot be used for
-- a non-remote access-to-subprogram type.
Wrong_Type (Expression (N), Designated_Type (Typ));
Found := True;
+ -- Check for view mismatch on Null in instances, for
+ -- which the view-swapping mechanism has no identifier.
+
+ elsif (In_Instance or else In_Inlined_Body)
+ and then (Nkind (N) = N_Null)
+ and then Is_Private_Type (Typ)
+ and then Is_Access_Type (Full_View (Typ))
+ then
+ Resolve (N, Full_View (Typ));
+ Set_Etype (N, Typ);
+ return;
+
-- Check for an aggregate. Sometimes we can get bogus
-- aggregates from misuse of parentheses, and we are
-- about to complain about the aggregate without even
Index_Node : Node_Id;
begin
- Check_Elab_Call (N);
if Component_Type (Etype (Nam)) /= Any_Type then
Index_Node :=
Set_Etype (Prefix (N), Etype (Nam));
Set_Etype (N, Typ);
Resolve_Indexed_Component (N, Typ);
+ Check_Elab_Call (Prefix (N));
end if;
return;
else
R := Range_Expression (Constraint (N));
+
+ if R = Error then
+ return;
+ end if;
+
Analyze (R);
if Base_Type (S) /= Base_Type (Typ) then
begin
-- For now allow circumvention of the restriction against
-- anonymous null access values via a debug switch to allow
- -- for easier trasition.
+ -- for easier transition.
if not Debug_Flag_J
and then Ekind (Typ) = E_Anonymous_Access_Type
-- 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;