Refine Ada overload matching
authorTom Tromey <tromey@adacore.com>
Tue, 28 Nov 2023 21:26:56 +0000 (14:26 -0700)
committerTom Tromey <tromey@adacore.com>
Fri, 15 Dec 2023 21:03:48 +0000 (14:03 -0700)
commitd56fdf1b976d32762c780a0107b20e61ce768967
tree65bfccbde4736a34f3a9a23782a5d9b39a21d960
parent1414fbf941140746862b920c6a1034099c4ff3d1
Refine Ada overload matching

Currently, the overload handling in Ada assumes that any two array
types are compatible.  However, this is obviously untrue, and a user
reported an oddity where comparing two Ada strings resulted in a call
to the "=" function for packed boolean arrays.

This patch improves the situation somewhat, by requiring that the two
arrays have the same arity and compatible base element types.  This is
still over-broad, but it seems safe and is better than the status quo.
gdb/ada-lang.c
gdb/testsuite/gdb.ada/overloads.exp [new file with mode: 0644]
gdb/testsuite/gdb.ada/overloads/overloads.adb [new file with mode: 0644]