]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add stopgap fix for PR ada/99360
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 21 Apr 2021 09:18:21 +0000 (11:18 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Wed, 21 Apr 2021 09:19:28 +0000 (11:19 +0200)
gcc/ada/
PR ada/99360
* exp_ch6.adb (Might_Have_Tasks): Return False when the type is the
class-wide type of a predefined iterator type.

gcc/ada/exp_ch6.adb

index 2cd40e42f47a2a5a1355cfa63cbc48657d175d34..c1dc371786d2ae887bf99749ea849873c1ac9206 100644 (file)
@@ -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;
 
    ----------------------------