http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49240
Summary: Inherited equality operator of interface not visible
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
AssignedTo: [email protected]
ReportedBy: [email protected]
package Types is
type Some_Interface is interface;
type Some_Type is new Some_Interface with private;
type Another_Type is new Some_Interface with private;
private
type Some_Type is new Some_Interface with null record;
type Another_Type is new Some_Interface with null record;
end Types;
--
with Ada.Text_IO;
with Types;
procedure Reproducer
is
use Types;
A : Types.Some_Type;
begin
if A = A then
Ada.Text_IO.Put_Line ("A is equal to itself");
end if;
end Reproducer;
--
Compiling this code leads to the following error message:
reproducer.adb:12:09: call to abstract function must be dispatching
According to RM 3.9.4,19/2 the declared types should inherit the equality
operator from the nonlimited interface.
This problem occurs when two types extending the same interface are declared in
the same package.
The reproducer compiles fine with GCC 4.3.2 so it seems this is a regression.