This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Fix another bug in handling of Ada 2005 anonymous access type


Tested on i686-linux, committed on HEAD

The following must compile quietly:

gcc -c -gnatws -gnat05 ambiguous.adb

with Def; use Def;

procedure Ambiguous is
   O : access Obj'Class;
   I : Integer;
begin
   I := Method (O);
   Meth (O);
   I := Method (D => O);
   I := O.Method;
end Ambiguous;
package body Def is
   yes : boolean;
   function Method (D : access JNI_Data) return Integer is begin return 0; end;
   procedure  Meth (I : access JNI_Data) is begin yes := true; end;
end Def;
package Def is
   type Root_Interface is limited Interface;
   function  Method (I : access Root_Interface) return Integer is abstract;
   procedure  Meth (I : access Root_Interface) is abstract;

   type JNI_Data is tagged null record;
   function  Method (D : access JNI_Data) return Integer;
   procedure  Meth (I : access JNI_Data);

   type Inter is interface and Root_Interface;
   type Obj is new JNI_Data and Inter with null record;
end Def;

2005-09-01  Javier Miranda  <miranda@adacore.com>
	    Ed Schonberg  <schonberg@adacore.com>

	* sem_disp.adb (Check_Controlling_Formals): Anonymous access types
	used in controlling parameters exclude null because it is necessary to
	read the tag to dispatch, and null has no tag.
	(Override_Dispatching_Operation): If the previous operation is inherited
	from an interface, it becomes hidden  and does not participate in later
	name resolution.

Attachment: difs.39
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]