Defer Ada character literal resolution
authorTom Tromey <tromey@adacore.com>
Thu, 1 Jul 2021 17:36:58 +0000 (11:36 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 2 Aug 2021 16:11:22 +0000 (10:11 -0600)
commit03adb248d621063cbbb0ce583cbd2e016ada7a6f
tree5d600cd66576f9e36bfae3573d4d593c1288d7c1
parent8b12db26d161d526953ab04ad92d598fd148d0bf
Defer Ada character literal resolution

In Ada, an enumeration type can use a character literal as one of the
enumerators.  The Ada expression parser handles the appropriate
conversion.

It turns out, though, that this conversion was handled incorrectly.
For an expression like TYPE'(EXP), the conversion would be done for
any such literal appearing in EXP -- but only the outermost such
expression should really be affected.

This patch defers the conversion until the resolution phase, fixing
the bug.
gdb/ada-exp.h
gdb/ada-exp.y
gdb/ada-lang.c
gdb/testsuite/gdb.ada/char_enum_overload.exp [new file with mode: 0644]
gdb/testsuite/gdb.ada/char_enum_overload/foo.adb [new file with mode: 0644]
gdb/testsuite/gdb.ada/char_enum_overload/pck.adb [new file with mode: 0644]
gdb/testsuite/gdb.ada/char_enum_overload/pck.ads [new file with mode: 0644]