[Ada] Vectors: spurious error in -gnatwE mode
This patch fixes a bug in which if Ada.Containers.Vectors is instantiated with
an Index_Type such that Index_Type'Base'Last is less than Count_Type'Last, and
the -gnatwE switch is used, the compiler gives spurious error messages.
The following test should compile quietly with -gnatwE:
gnatmake short_vectors.ads -gnatwa -gnatwE -gnatf
with Ada.Containers.Vectors;
package Short_Vectors is
type Index_Type is range 1 .. 256;
package Map_Pkg is new Ada.Containers.Vectors
(Index_Type => Index_Type,
Element_Type => Integer);
end Short_Vectors;
2018-05-23 Bob Duff <duff@adacore.com>
gcc/ada/
* libgnat/a-convec.adb: (Insert, Insert_Space): Suppress warnings. The
code in question is not reachable in the case where Count_Type'Last is
out of range.
From-SVN: r260590