]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Thu, 1 Sep 2011 13:22:54 +0000 (15:22 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 1 Sep 2011 13:22:54 +0000 (15:22 +0200)
2011-09-01  Robert Dewar  <dewar@adacore.com>

* inline.adb, sem_aggr.adb: Minor reformatting.

2011-09-01  Ed Schonberg  <schonberg@adacore.com>

* a-convec.adb: Proper handling of cursors for Ada2012 iterators.

From-SVN: r178413

gcc/ada/ChangeLog
gcc/ada/a-convec.adb
gcc/ada/inline.adb
gcc/ada/sem_aggr.adb

index 7e70cf788ab153d5348dbc5d3f762ad8f604f944..2e1501148c43ae0e195cc5f54dfd5f7087d7015e 100644 (file)
@@ -1,3 +1,11 @@
+2011-09-01  Robert Dewar  <dewar@adacore.com>
+
+       * inline.adb, sem_aggr.adb: Minor reformatting.
+
+2011-09-01  Ed Schonberg  <schonberg@adacore.com>
+
+       * a-convec.adb: Proper handling of cursors for Ada2012 iterators.
+
 2011-09-01  Robert Dewar  <dewar@adacore.com>
 
        * prj-proc.adb, exp_ch6.adb, prj-env.adb: Minor reformatting.
index 08220e9e36b7764801429c81944bc61b82bdd0a4..0d39ce15011ac1a831642b8dfb2e1a04cb0fd9c7 100644 (file)
@@ -800,9 +800,12 @@ package body Ada.Containers.Vectors is
    end First;
 
    function First (Object : Iterator) return Cursor is
-      C : constant Cursor := (Object.Container, Index_Type'First);
    begin
-      return C;
+      if Is_Empty (Object.Container.all) then
+         return No_Element;
+      end if;
+
+      return Cursor'(Object.Container, Index_Type'First);
    end First;
 
    -------------------
@@ -2044,8 +2047,7 @@ package body Ada.Containers.Vectors is
    function Iterate (Container : Vector; Start : Cursor)
       return Vector_Iterator_Interfaces.Reversible_Iterator'class
    is
-      It : constant Iterator :=
-             (Container'Unchecked_Access, Start.Index);
+      It : constant Iterator := (Container'Unchecked_Access, Start.Index);
    begin
       return It;
    end Iterate;
@@ -2064,9 +2066,12 @@ package body Ada.Containers.Vectors is
    end Last;
 
    function Last (Object : Iterator) return Cursor is
-      C : constant Cursor := (Object.Container, Object.Container.Last);
    begin
-      return C;
+      if Is_Empty (Object.Container.all) then
+         return No_Element;
+      end if;
+
+      return Cursor'(Object.Container, Object.Container.Last);
    end Last;
 
    ------------------
index 98bbbf09531f080c4358fa3bd211d3f02dc1971f..609c803db692487b6a3c1a43aaaa93de1bacdb77 100644 (file)
@@ -341,7 +341,7 @@ package body Inline is
                if Is_Generic_Instance (Pack) then
                   null;
 
-               --  Do not inline the package if the subprogram is an init. proc
+               --  Do not inline the package if the subprogram is an init proc
                --  or other internally generated subprogram, because in that
                --  case the subprogram body appears in the same unit that
                --  declares the type, and that body is visible to the back end.
index cdfaedeaa56bcd0c34e6bf0d4261a2ea60a36073..4af133c2367139ef869b65deb5b517f48a5afe58 100644 (file)
@@ -1229,7 +1229,7 @@ package body Sem_Aggr is
 
       elsif Is_Private_Type (Typ)
         and then Present (Full_View (Typ))
-        and then (In_Inlined_Body or else In_Instance_Body)
+        and then (In_Inlined_Body or In_Instance_Body)
         and then Is_Composite_Type (Full_View (Typ))
       then
          Resolve (N, Full_View (Typ));