OSDN Git Service

* configure.in (all_headers, all_lib2funcs): Remove.
[pf3gnuchains/gcc-fork.git] / gcc / ada / sem_res.adb
index bf1a715..09b5585 100644 (file)
@@ -787,7 +787,7 @@ package body Sem_Res is
       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;
@@ -5008,7 +5008,7 @@ package body Sem_Res is
 
       --  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.
 
@@ -5033,6 +5033,25 @@ package body Sem_Res is
       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
 
@@ -5128,6 +5147,7 @@ package body Sem_Res is
         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;