mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-02-05 12:53:16 +08:00
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.
32 lines
1.0 KiB
Ada
32 lines
1.0 KiB
Ada
-- Copyright 2021 Free Software Foundation, Inc.
|
|
--
|
|
-- This program is free software; you can redistribute it and/or modify
|
|
-- it under the terms of the GNU General Public License as published by
|
|
-- the Free Software Foundation; either version 3 of the License, or
|
|
-- (at your option) any later version.
|
|
--
|
|
-- This program is distributed in the hope that it will be useful,
|
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
-- GNU General Public License for more details.
|
|
--
|
|
-- You should have received a copy of the GNU General Public License
|
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
package body Pck is
|
|
procedure Overloaded (Value : Global_Enum_Type) is
|
|
begin
|
|
null;
|
|
end Overloaded;
|
|
|
|
function Overloaded (Value : Character) return Global_Enum_Type is
|
|
begin
|
|
return 'Y';
|
|
end Overloaded;
|
|
|
|
procedure Do_Nothing (A : System.Address) is
|
|
begin
|
|
null;
|
|
end Do_Nothing;
|
|
end Pck;
|