OSDN Git Service

2011-09-02 Robert Dewar <dewar@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 2 Sep 2011 09:57:21 +0000 (09:57 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 2 Sep 2011 09:57:21 +0000 (09:57 +0000)
* sem_prag.adb, sem_util.adb, sem_ch6.adb, prj-nmsc.adb,
exp_ch3.adb: Minor reformatting.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178459 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/exp_ch3.adb
gcc/ada/prj-nmsc.adb
gcc/ada/sem_ch6.adb
gcc/ada/sem_prag.adb
gcc/ada/sem_util.adb

index 0c81255..91b2ebf 100644 (file)
@@ -1,3 +1,8 @@
+2011-09-02  Robert Dewar  <dewar@adacore.com>
+
+       * sem_prag.adb, sem_util.adb, sem_ch6.adb, prj-nmsc.adb,
+       exp_ch3.adb: Minor reformatting.
+
 2011-09-02  Vincent Celier  <celier@adacore.com>
 
        * prj-conf.adb (Add_Default_GNAT_Naming_Scheme): Declare "gcc"
index a8cde1e..4b5b26f 100644 (file)
@@ -4982,7 +4982,7 @@ package body Exp_Ch3 is
                         Insert_Action (N,
                           Make_Object_Declaration (Loc,
                             Defining_Identifier => Obj_Id,
-                            Object_Definition =>
+                            Object_Definition   =>
                               New_Occurrence_Of
                                 (Etype (Object_Definition (N)), Loc),
                             Expression => New_Expr));
@@ -4992,14 +4992,13 @@ package body Exp_Ch3 is
                      --  has been previously expanded into a temporary object.
 
                      else pragma Assert (not Comes_From_Source (Expr_Q));
-
                         Insert_Action (N,
                           Make_Object_Renaming_Declaration (Loc,
                             Defining_Identifier => Obj_Id,
-                            Subtype_Mark =>
+                            Subtype_Mark        =>
                               New_Occurrence_Of
                                 (Etype (Object_Definition (N)), Loc),
-                            Name =>
+                            Name                =>
                               Unchecked_Convert_To
                                 (Etype (Object_Definition (N)), New_Expr)));
                      end if;
index 5761209..bf6f4cb 100644 (file)
@@ -6769,7 +6769,6 @@ package body Prj.Nmsc is
       if Source.Unit /= null then
          if Source.Kind = Spec then
             Source.Unit.File_Names (Spec) := Source;
-
          else
             Source.Unit.File_Names (Impl) := Source;
          end if;
index 4b4e2ca..32c2dbb 100644 (file)
@@ -4956,7 +4956,7 @@ package body Sem_Ch6 is
                  ("subprogram & overrides inherited operation #", Spec, Subp);
             end if;
 
-         --  Special-case to fix a GNAT oddity:  Limited_Controlled is declared
+         --  Special-case to fix a GNAT oddity: Limited_Controlled is declared
          --  as an extension of Root_Controlled, and thus has a useless Adjust
          --  operation. This operation should not be inherited by other limited
          --  controlled types. An explicit Adjust for them is not overriding.
@@ -4965,8 +4965,9 @@ package body Sem_Ch6 is
            and then Chars (Overridden_Subp) = Name_Adjust
            and then Is_Limited_Type (Etype (First_Formal (Subp)))
            and then Present (Alias (Overridden_Subp))
-           and then Is_Predefined_File_Name
-             (Unit_File_Name (Get_Source_Unit (Alias (Overridden_Subp))))
+           and then
+             Is_Predefined_File_Name
+               (Unit_File_Name (Get_Source_Unit (Alias (Overridden_Subp))))
          then
             Error_Msg_NE ("subprogram & is not overriding", Spec, Subp);
 
index 27f4c8a..c3b5dc8 100644 (file)
@@ -262,6 +262,11 @@ package body Sem_Prag is
       Preanalyze_Spec_Expression
         (Get_Pragma_Arg (Arg1), Standard_Boolean);
 
+      --  For a class-wide condition, a reference to a controlling formal must
+      --  be interpreted as having the class-wide type (or an access to such)
+      --  so that the inherited condition can be properly applied to any
+      --  overriding operation (see ARM12 6.6.1 (7)).
+
       if Class_Present (N) then
          declare
             T   : constant Entity_Id := Find_Dispatching_Type (S);
index 23105c5..848643c 100644 (file)
@@ -12747,6 +12747,7 @@ package body Sem_Util is
       then
          return Get_Name_String (Name_Standard) & "__" &
            Get_Name_String (Chars (E));
+
       elsif Ekind (E) = E_Enumeration_Literal then
          return Unique_Name (Etype (E)) & "__" & Get_Name_String (Chars (E));