diff options
author | Claire Dross <dross@adacore.com> | 2022-05-09 15:44:22 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-06-02 09:06:37 +0000 |
commit | 878043af338c3b49f7848f3b73938cfa75a97393 (patch) | |
tree | 5c743dc977487d9ae22a27ced24d6eff8fbebc58 /gcc | |
parent | f03f48a3843046a4ee888db3b86c0efe3812e2c7 (diff) | |
download | gcc-878043af338c3b49f7848f3b73938cfa75a97393.zip gcc-878043af338c3b49f7848f3b73938cfa75a97393.tar.gz gcc-878043af338c3b49f7848f3b73938cfa75a97393.tar.bz2 |
[Ada] Fix iteration on formal vectors
We need to use Extended_Index for the Position parameter of the Element
function in formal vectors so it is compatible with other primitives of
the Iterable aspect.
gcc/ada/
* libgnat/a-cfinve.ads (Element): Change the type of the
Position parameter to Extended_Index.
* libgnat/a-cfinve.adb (Element): Idem.
* libgnat/a-cofove.ads (Element): Idem.
* libgnat/a-cofove.adb (Element): Idem.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/libgnat/a-cfinve.adb | 2 | ||||
-rw-r--r-- | gcc/ada/libgnat/a-cfinve.ads | 2 | ||||
-rw-r--r-- | gcc/ada/libgnat/a-cofove.adb | 2 | ||||
-rw-r--r-- | gcc/ada/libgnat/a-cofove.ads | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/gcc/ada/libgnat/a-cfinve.adb b/gcc/ada/libgnat/a-cfinve.adb index 17b57cb..a55786d 100644 --- a/gcc/ada/libgnat/a-cfinve.adb +++ b/gcc/ada/libgnat/a-cfinve.adb @@ -432,7 +432,7 @@ is function Element (Container : Vector; - Index : Index_Type) return Element_Type + Index : Extended_Index) return Element_Type is begin if Index > Container.Last then diff --git a/gcc/ada/libgnat/a-cfinve.ads b/gcc/ada/libgnat/a-cfinve.ads index ec6af99..b5fa29b 100644 --- a/gcc/ada/libgnat/a-cfinve.ads +++ b/gcc/ada/libgnat/a-cfinve.ads @@ -284,7 +284,7 @@ is function Element (Container : Vector; - Index : Index_Type) return Element_Type + Index : Extended_Index) return Element_Type with Global => null, Pre => Index in First_Index (Container) .. Last_Index (Container), diff --git a/gcc/ada/libgnat/a-cofove.adb b/gcc/ada/libgnat/a-cofove.adb index 5f10f57..c921184 100644 --- a/gcc/ada/libgnat/a-cofove.adb +++ b/gcc/ada/libgnat/a-cofove.adb @@ -370,7 +370,7 @@ is function Element (Container : Vector; - Index : Index_Type) return Element_Type + Index : Extended_Index) return Element_Type is begin if Index > Container.Last then diff --git a/gcc/ada/libgnat/a-cofove.ads b/gcc/ada/libgnat/a-cofove.ads index edf9532..cba10a6 100644 --- a/gcc/ada/libgnat/a-cofove.ads +++ b/gcc/ada/libgnat/a-cofove.ads @@ -263,7 +263,7 @@ is function Element (Container : Vector; - Index : Index_Type) return Element_Type + Index : Extended_Index) return Element_Type with Global => null, Pre => Index in First_Index (Container) .. Last_Index (Container), |