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] Entry family calls on single protected object that implements interfaces


If the prefix is a single protected object and the selector is a discriminant
or an entry family, this is a non-overloaded candidate interpretation, and
possible primitive operations of the type must not be examined.

The following must compile and execute quietly in Ada 2005 mode:

---
with FooBar;
procedure Interface_Entry_Family is
   I : FooBar.Index := 1;
begin
   FooBar.Bar.E(I)(1337);
end Interface_Entry_Family;
--
package FooBar is
   type Foo is protected interface;
   procedure P(Self : in out Foo) is abstract;
   
   type Index is range 1..1;

   protected Bar is
   new Foo with -- remove this line, and it will compile.
      
      procedure P;
      
      entry E(Index)(Baz : Integer);
      
   end Bar;
end FooBar;
---
package body FooBar is
   protected body Bar is
      
      procedure P is
      begin
         null;
      end P;
      
      entry E(for I in Index)(Baz : Integer) when True is
      begin
         null;
      end E;      
      
   end Bar;
end FooBar;
---

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

2011-09-27  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch4.adb (Analyze_Selected_Component): If the prefix is a
	single protected object and the selector is a discriminant or an
	entry family, this is a non-overloaded candidate interpretation,
	and possible primitive operations of the type must not be
	examined.

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]