Hi,

I'd like to apply the attached stopgap fix for PR ada/99360 on the 11 branch, 
as the real fix is really stage #1 material.  This is a regression there.

Bootstrapped/regtested on x86-64/Linux, OK for the 11 branch?


2021-04-20  Eric Botcazou  <ebotca...@adacore.com>
            Bob Duff  <d...@adacore.com>

        PR ada/99360
        * exp_ch6.adb (Might_Have_Tasks): Return False when the type is the
        class-wide type of a predefined iterator type.

-- 
Eric Botcazou
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index 2cd40e42f47..c1dc371786d 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -9616,7 +9616,15 @@ package body Exp_Ch6 is
         and then not No_Run_Time_Mode
         and then (Has_Task (Typ)
                     or else (Is_Class_Wide_Type (Typ)
-                               and then Is_Limited_Record (Typ)));
+                               and then Is_Limited_Record (Typ)))
+
+        --  Predefined iterator types do not contain tasks, even when
+        --  class-wide.
+
+        and then not (In_Predefined_Unit (Typ)
+                        and then Chars (Typ) in
+                          Name_Find ("Tforward_iteratorC") |
+                          Name_Find ("Treversible_iteratorC"));
    end Might_Have_Tasks;
 
    ----------------------------

Reply via email to