[Ada] Unsupported Object.Operation notation with synchronized types

Arnaud Charlet charlet@adacore.com
Thu Jul 31 14:47:00 GMT 2008


The frontend diagnoses errors in the use of object.operation notation
with synchronized types. After this patch gnat.dg/sync_iface_test.adb
compiles without errors.

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

2008-07-31  Javier Miranda  <miranda@adacore.com>

	* sem_ch4.adb (Valid_First_Argument_Of): Complete its functionality to
	handle synchronized types. Required to handle well the object.operation
	notation applied to synchronized types.

-------------- next part --------------
Index: sem_ch4.adb
===================================================================
--- sem_ch4.adb	(revision 138400)
+++ sem_ch4.adb	(working copy)
@@ -6380,9 +6380,15 @@ package body Sem_Ch4 is
          -----------------------------
 
          function Valid_First_Argument_Of (Op : Entity_Id) return Boolean is
-            Typ : constant Entity_Id := Etype (First_Formal (Op));
+            Typ : Entity_Id := Etype (First_Formal (Op));
 
          begin
+            if Is_Concurrent_Type (Typ)
+              and then Present (Corresponding_Record_Type (Typ))
+            then
+               Typ := Corresponding_Record_Type (Typ);
+            end if;
+
             --  Simple case. Object may be a subtype of the tagged type or
             --  may be the corresponding record of a synchronized type.
 


More information about the Gcc-patches mailing list