From 43852482cafa73da6408120722dcbe7ff6fd3ded Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Wed, 25 Nov 2020 12:05:47 +0100 Subject: [PATCH] [Ada] Complain about missing -gnat2020 switch on iterator_filter gcc/ada/ * par-ch5.adb (P_Loop_Parameter_Specification): Complain about missing -gnat2020 switch. (P_Iterator_Specification): Likewise. --- gcc/ada/par-ch5.adb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/ada/par-ch5.adb b/gcc/ada/par-ch5.adb index 5b002c46f06..ce02af72773 100644 --- a/gcc/ada/par-ch5.adb +++ b/gcc/ada/par-ch5.adb @@ -1712,9 +1712,9 @@ package body Ch5 is Set_Discrete_Subtype_Definition (Loop_Param_Specification_Node, P_Discrete_Subtype_Definition); - if Ada_Version >= Ada_2020 - and then Token = Tok_When - then + if Token = Tok_When then + Error_Msg_Ada_2020_Feature ("iterator filter", Token_Ptr); + Scan; -- past WHEN Set_Iterator_Filter (Loop_Param_Specification_Node, P_Condition); @@ -1773,9 +1773,9 @@ package body Ch5 is Set_Name (Node1, P_Name); - if Ada_Version >= Ada_2020 - and then Token = Tok_When - then + if Token = Tok_When then + Error_Msg_Ada_2020_Feature ("iterator filter", Token_Ptr); + Scan; -- past WHEN Set_Iterator_Filter (Node1, P_Condition); -- 2.30.2