diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-10-17 09:11:14 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-10-17 09:11:14 +0000 |
commit | 856a9917ae1b8088af710a53a68093bfc3bbc9da (patch) | |
tree | 9ee5f817a683d0157c79b91d46374083b7c80f46 /gcc/ada/sem_ch5.adb | |
parent | 5f299c270dc8fd1f6455c2738150d35ce4057faa (diff) | |
download | gcc-856a9917ae1b8088af710a53a68093bfc3bbc9da.tar.gz |
2014-10-17 Ed Schonberg <schonberg@adacore.com>
* exp_ch3.adb (Build_Component_Invariant_Call): Retrieve Invariant
subprogram from base type.
* sem_ch7.adb (Analyze_Package_Specification): Build invariant
subprogram for private type, not any of its subtypes.
* sem_ch13.adb (Build_Invariant_Procedure_Declaration): Set type
of procedure entity, because a call to it may be generated in
a client unit before the corresponding subprogram declaration
is analyzed.
2014-10-17 Vincent Celier <celier@adacore.com>
* prj-nmsc.adb (Get_Directories): Do not create directories
when a project is abstract.
2014-10-17 Ed Schonberg <schonberg@adacore.com>
* sem_ch5.adb (Analyze_Iterator_Specification): If the domain
of iteration is given by an expression that is not an array type,
verify that its type implements an iterator iterface.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216380 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch5.adb')
-rw-r--r-- | gcc/ada/sem_ch5.adb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 22d11b01e65..c8d27f1384b 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -1838,6 +1838,17 @@ package body Sem_Ch5 is else Typ := Etype (Iter_Name); + + -- Verify that the expression produces an iterator. + + if not Of_Present (N) and then not Is_Iterator (Typ) + and then not Is_Array_Type (Typ) + and then No (Find_Aspect (Typ, Aspect_Iterable)) + then + Error_Msg_N + ("expect object that implements iterator interface", + Iter_Name); + end if; end if; -- Protect against malformed iterator |