From 3fc40cd783cb149d7d6c328def33606ec17ab15f Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: Mon, 9 Oct 2017 20:47:26 +0000 Subject: [multiple changes] 2017-10-09 Hristian Kirtchev * sem_unit.adb (Find_Enclosing_Scope): Do not treat a block statement as a scoping construct when it is byproduct of exception handling. 2017-10-09 Hristian Kirtchev * sinfo.ads: Update table Is_Syntactic_Field to reflect the nature of semantic field Target of node N_Call_Marker. 2017-10-09 Ed Schonberg * sem_res.adb (Resolve_Allocator): Reject properly an allocator that attempts to copy a limited value, when the allocator is the expression in an expression function. 2017-10-09 Joel Brobecker * doc/share/conf.py: Tell the style checker that this is a Python fragment, and therefore that pyflakes should not be run to validate this file. 2017-10-09 Eric Botcazou * einfo.ads (Is_Boolean_Type): Add pragma Inline. (Is_Entity_Name): Likewise. (Is_String_Type): Likewise. * sem_type.adb (Full_View_Covers): Do not test Is_Private_Type here and remove useless comparisons on the base types. (Covers): Use simple tests for Standard_Void_Type. Move up cheap tests on T2. Always test Is_Private_Type before Full_View_Covers. 2017-10-09 Bob Duff * exp_ch4.adb: Minor refactoring. From-SVN: r253568 --- gcc/ada/sem_ch13.adb | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'gcc/ada/sem_ch13.adb') diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 701aa08..564ff0d 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -13193,17 +13193,16 @@ package body Sem_Ch13 is or else No (First_Formal (Entity (N))) or else Etype (First_Formal (Entity (N))) /= Typ then - Error_Msg_N ("iterable primitive must be local function name " - & "whose first formal is an iterable type", N); + Error_Msg_N + ("iterable primitive must be local function name whose first " + & "formal is an iterable type", N); return; end if; Ent := Entity (N); - F1 := First_Formal (Ent); + F1 := First_Formal (Ent); - if Nam = Name_First - or else Nam = Name_Last - then + if Nam = Name_First or else Nam = Name_Last then -- First or Last (Container) => Cursor @@ -13242,6 +13241,7 @@ package body Sem_Ch13 is -- Has_Element (Container, Cursor) => Boolean F2 := Next_Formal (F1); + if Etype (F2) /= Cursor or else Etype (Ent) /= Standard_Boolean or else Present (Next_Formal (F2)) @@ -13258,15 +13258,14 @@ package body Sem_Ch13 is then Error_Msg_N ("no match for Element iterable primitive", N); end if; - null; else raise Program_Error; end if; else - -- Overloaded case: find subprogram with proper signature. - -- Caller will report error if no match is found. + -- Overloaded case: find subprogram with proper signature. Caller + -- will report error if no match is found. declare I : Interp_Index; @@ -14108,10 +14107,8 @@ package body Sem_Ch13 is elsif No (Has_Element_Id) then Error_Msg_N ("match for Has_Element primitive not found", ASN); - elsif No (Element_Id) - or else No (Last_Id) - then - null; -- Optional. + elsif No (Element_Id) or else No (Last_Id) then + null; -- optional end if; end Validate_Iterable_Aspect; -- cgit v1.1