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 regression in imported C++ type that cover interface primitives


This patch fixes a regression of the compiler in the management of imported
C++ types that cover interfaces. The following test now compiles without
errors.

package Animals is
   type Carnivore is limited interface;
   function Number_Of_Teeth (X : Carnivore) return Natural is abstract;
   pragma Convention (CPP, Number_Of_Teeth);

   type Animal is tagged limited null record;
   pragma Import (CPP, Animal);

   type Dog is new Animal and Carnivore with null record;
   pragma Import (CPP, Dog);

   function Number_Of_Teeth (A : Dog) return Natural;
   pragma Import (CPP, Number_Of_Teeth);
end Animals;

Command: gcc -c -gnat05 animals.ads -gnatws

Tested on x86_64-pc-linux-gnu, committed on trunk

2010-10-26  Javier Miranda  <miranda@adacore.com>

	* sem_prag.adb (Process_Import_Or_Interface): Skip primitives of
	interface types when processing all the entities in the homonym chain
	that are declared in the same declarative part.

Attachment: difs
Description: Text document


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