[Ada] Use correct subtype for call to Last in formal vectors
authorClaire Dross <dross@adacore.com>
Thu, 12 Dec 2019 10:02:14 +0000 (10:02 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Thu, 12 Dec 2019 10:02:14 +0000 (10:02 +0000)
2019-12-12  Claire Dross  <dross@adacore.com>

gcc/ada/

* libgnat/a-cofove.adb, libgnat/a-cfinve.adb (Find_Index): Use
Extended_Index for call to Last.

From-SVN: r279284

gcc/ada/ChangeLog
gcc/ada/libgnat/a-cfinve.adb
gcc/ada/libgnat/a-cofove.adb

index 3d0ede43d9d13b9c27a9c6cd628e099735182ca0..99b142c14284867cf6e52c0c53f1c332a07f8428 100644 (file)
@@ -1,3 +1,8 @@
+2019-12-12  Claire Dross  <dross@adacore.com>
+
+       * libgnat/a-cofove.adb, libgnat/a-cfinve.adb (Find_Index): Use
+       Extended_Index for call to Last.
+
 2019-12-12  Gary Dismukes  <dismukes@adacore.com>
 
        * sem_ch3.adb, sem_util.adb: Minor reformatting.
index a1871280ddeae9c479459d4e79a28a89d7b86762..b5c318b7ba199545a785a35332c5162aad6c7e1f 100644 (file)
@@ -458,7 +458,7 @@ is
       Index     : Index_Type := Index_Type'First) return Extended_Index
    is
       K    : Count_Type;
-      Last : constant Index_Type := Last_Index (Container);
+      Last : constant Extended_Index := Last_Index (Container);
 
    begin
       K := Capacity_Range (Int (Index) - Int (No_Index));
index 3a10d32287402074b0df799ef9397e1c4510c108..1240a505d59cbd15f049cc95ae6fc063905bbeb6 100644 (file)
@@ -379,7 +379,7 @@ is
       Index     : Index_Type := Index_Type'First) return Extended_Index
    is
       K    : Count_Type;
-      Last : constant Index_Type := Last_Index (Container);
+      Last : constant Extended_Index := Last_Index (Container);
 
    begin
       K := Capacity_Range (Int (Index) - Int (No_Index));