This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ada/14416] New: [3.4 Regression] Gnat does not compile valid code with redefined "="
- From: "n dot brunot at cadwin dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Mar 2004 20:36:05 -0000
- Subject: [Bug ada/14416] New: [3.4 Regression] Gnat does not compile valid code with redefined "="
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
found with 3.4.0 on native Linux and native Mingw
version 3.3.3 was fine
-- gnatmake -v gnat_equal_bug.adb
--
-- GNATMAKE 3.4.0 20040225 (prerelease) Copyright 1995-2004 Free Software
Foundation, Inc.
-- "gnat_equal_bug.ali" being checked ...
-- -> "gnat_equal_bug.ali" missing.
-- gcc -c gnat_equal_bug.adb
-- gnat_equal_bug.adb:27:04: instantiation error at line 18
-- gnat_equal_bug.adb:27:04: expected
type "Ada.Strings.Bounded.Bounded_String" from instance at line 25
-- gnat_equal_bug.adb:27:04: instantiation error at line 18
-- gnat_equal_bug.adb:27:04: found type "Ada.Strings.Bounded.Bounded_String"
from instance at line 25
-- End of compilation
-- gnatmake: "gnat_equal_bug.adb" compilation error
with Ada.Strings.Bounded;
procedure Gnat_Equal_Bug is
generic
type Element_Type is private;
type Index_Type is (<>);
type Element_Array is array (Index_Type range <>) of Element_Type;
with function Equal (Left, Right : Element_Type) return Boolean is "=";
function Generic_Presence (Left : Element_Type;
Right : Element_Array)
return Boolean;
function Generic_Presence (Left : Element_Type;
Right : Element_Array)
return Boolean is
begin
for I in Right'range loop
if Equal (Right (I), Left) then
return True;
end if;
end loop;
return False;
end Generic_Presence;
package Bnd_Str_128 is new Ada.Strings.Bounded.Generic_Bounded_Length (128);
type Bounded_String_Array is array (Positive range <>) of
Bnd_Str_128.Bounded_String;
function Item_Presence is new
Generic_Presence (Bnd_Str_128.Bounded_String, Positive,
Bounded_String_Array, Bnd_Str_128."=");
begin
null;
end Gnat_Equal_Bug;
--
Summary: [3.4 Regression] Gnat does not compile valid code with
redefined "="
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: ada
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: n dot brunot at cadwin dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14416