From 53e85b38aaa10f5f8fe35eeea454a92c293cbc67 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 21 Apr 2021 11:18:21 +0200 Subject: [PATCH] Add stopgap fix for PR ada/99360 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 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 2cd40e42f47a..c1dc371786d2 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; ---------------------------- -- 2.47.3