Handle type qualifier for enumeration name
authorTom Tromey <tromey@adacore.com>
Thu, 1 Jul 2021 14:55:15 +0000 (08:55 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 2 Aug 2021 16:11:23 +0000 (10:11 -0600)
commitba8694b650b60c29126fd958575ffa1ca4f6c415
treea4f420223e3b0da8bd2b1608694b70bfe8eeac3b
parent17a3da839932b79dcccfdf41867965892b756540
Handle type qualifier for enumeration name

Pierre-Marie noticed that the Ada expression "TYPE'(NAME)" resolved
incorrectly when "TYPE" was an enumeration type.  Here, "NAME" should
be unambiguous.

This patch fixes this problem.  Note that the patch is not perfect --
it does not give an error if TYPE is an enumeration type but NAME is
not an enumerator but does have some other meaning in scope.  Fixing
this proved difficult, and so I've left it out.
gdb/ada-lang.c
gdb/testsuite/gdb.ada/enum_qual.exp [new file with mode: 0644]
gdb/testsuite/gdb.ada/enum_qual/gener.ads [new file with mode: 0644]
gdb/testsuite/gdb.ada/enum_qual/qual.adb [new file with mode: 0644]