aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch13.adb
diff options
context:
space:
mode:
authorPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2017-10-09 20:47:26 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2017-10-09 20:47:26 +0000
commit3fc40cd783cb149d7d6c328def33606ec17ab15f (patch)
tree5464e584db086ae7844c699ab4fedf3aea926122 /gcc/ada/sem_ch13.adb
parent367601d1238a0b997ec9321ab2c58e5557d972c2 (diff)
downloadgcc-3fc40cd783cb149d7d6c328def33606ec17ab15f.zip
gcc-3fc40cd783cb149d7d6c328def33606ec17ab15f.tar.gz
gcc-3fc40cd783cb149d7d6c328def33606ec17ab15f.tar.bz2
[multiple changes]
2017-10-09 Hristian Kirtchev <kirtchev@adacore.com> * 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 <kirtchev@adacore.com> * 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 <schonberg@adacore.com> * 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 <brobecker@adacore.com> * 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 <ebotcazou@adacore.com> * 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 <duff@adacore.com> * exp_ch4.adb: Minor refactoring. From-SVN: r253568
Diffstat (limited to 'gcc/ada/sem_ch13.adb')
-rw-r--r--gcc/ada/sem_ch13.adb23
1 files changed, 10 insertions, 13 deletions
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;