end if;
if Present (Ctrl_Type) then
-
- -- Obtain the full type in case we are looking at an incomplete
- -- view.
+ -- Use the full view for an incomplete type
if Ekind (Ctrl_Type) = E_Incomplete_Type
and then Present (Full_View (Ctrl_Type))
Ctrl_Type := Full_View (Ctrl_Type);
end if;
- -- When controlling type is concurrent and declared within a
- -- generic or inside an instance use corresponding record type.
+ -- Use the corresponding record type for a concurrent type
if Is_Concurrent_Type (Ctrl_Type)
and then Present (Corresponding_Record_Type (Ctrl_Type))
Ctrl_Type := Check_Controlling_Type (Etype (Subp), Subp);
if Present (Ctrl_Type) then
+ -- Use the full view for an incomplete type
+
+ if Ekind (Ctrl_Type) = E_Incomplete_Type
+ and then Present (Full_View (Ctrl_Type))
+ then
+ Ctrl_Type := Full_View (Ctrl_Type);
+ end if;
+
+ -- Use the corresponding record type for a concurrent type
+
+ if Is_Concurrent_Type (Ctrl_Type)
+ and then Present (Corresponding_Record_Type (Ctrl_Type))
+ then
+ Ctrl_Type := Corresponding_Record_Type (Ctrl_Type);
+ end if;
+
if Ctrl_Type = Typ then
Set_Has_Controlling_Result (Subp);
--- /dev/null
+package Task6 is
+
+ type Int is task interface;
+
+ procedure E (T: Int) is abstract;
+
+ task type T is new Int with
+ entry E;
+ end T;
+
+ function Make return T;
+
+end Task6;