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] Further illegalities with operator call in functional notation


With this patch the compiler properly rejects a call of the form P."+" (X, Y)
when X and Y are numeric literals, and the result type is not declared in P.

Compiling the following must be rejected with:

   derived_folded_mistyped.adb:8:27: expect type "T3"
---
procedure Derived_Folded_Mistyped is
   package Scop is
      type T2 is range 1 .. 4;
   end Scop;

   type T3 is new Scop.T2;
   X : constant T3 := Scop."+" (1, 2); --  ERROR: Scop."+" returns T2
begin
   null;
end Derived_Folded_Mistyped;

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

2010-06-22  Ed Schonberg  <schonberg@adacore.com>

	* sem_res.adb (Make_Call_Into_Operator): Diagnose an incorrect scope
	for an operator in a functional notation, when operands are universal.

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]