]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/ada/exp_ch3.adb
[Ada] Undefined master in task with limited class-wide aliased entry formal
[thirdparty/gcc.git] / gcc / ada / exp_ch3.adb
index 1901ea573983d4ae4eff8dbd4d3a3db850582adf..87636002aa08202262135715a0a02dcdf771b468 100644 (file)
@@ -5518,7 +5518,14 @@ package body Exp_Ch3 is
          --  Note: This code covers access-to-limited-interfaces because they
          --        can be used to reference tasks implementing them.
 
-         elsif Is_Limited_Class_Wide_Type (Desig_Typ)
+         --  Suppress the master creation for access types created for entry
+         --  formal parameters (parameter block component types). Seems like
+         --  suppression should be more general for compiler-generated types,
+         --  but testing Comes_From_Source, like the code above does, may be
+         --  too general in this case (affects some test output)???
+
+         elsif not Is_Param_Block_Component_Type (Ptr_Typ)
+           and then Is_Limited_Class_Wide_Type (Desig_Typ)
            and then Tasking_Allowed
          then
             Build_Class_Wide_Master (Ptr_Typ);