diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-05-21 15:19:28 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-05-21 15:19:28 +0200 |
commit | 65529f748184741575136af3aab497059ff2aa10 (patch) | |
tree | fce8c3359f53c9f552016649f0eecde3c0682b48 /gcc/ada/sem_ch5.adb | |
parent | d3289ba2b4ee27a776fa4c678739b50c6d1d919d (diff) | |
download | gcc-65529f748184741575136af3aab497059ff2aa10.zip gcc-65529f748184741575136af3aab497059ff2aa10.tar.gz gcc-65529f748184741575136af3aab497059ff2aa10.tar.bz2 |
[multiple changes]
2014-05-21 Robert Dewar <dewar@adacore.com>
* sem_warn.adb: Minor fix to warning messages (use ?? instead
of ?).
2014-05-21 Vincent Celier <celier@adacore.com>
* gnatcmd.adb (GNATCmd): For platforms other than VMS, recognize
switch --version and --help.
2014-05-21 Robert Dewar <dewar@adacore.com>
* sem_elab.adb (Is_Call_Of_Generic_Formal): New function.
2014-05-21 Ed Schonberg <schonberg@adacore.com>
* sem_ch5.adb (Analyze_Iterator_Specification): Set type of
iterator variable when the domain of iteration is a formal
container and this is an element iterator.
2014-05-21 Bob Duff <duff@adacore.com>
* sem_ch12.adb: Minor reformatting.
From-SVN: r210707
Diffstat (limited to 'gcc/ada/sem_ch5.adb')
-rw-r--r-- | gcc/ada/sem_ch5.adb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 41f310d..5f14622 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -1868,9 +1868,18 @@ package body Sem_Ch5 is if Of_Present (N) then if Has_Aspect (Typ, Aspect_Iterable) then - if No (Get_Iterable_Type_Primitive (Typ, Name_Element)) then - Error_Msg_N ("missing Element primitive for iteration", N); - end if; + declare + Elt : constant Entity_Id := + Get_Iterable_Type_Primitive (Typ, Name_Element); + begin + if No (Elt) then + Error_Msg_N + ("missing Element primitive for iteration", N); + + else + Set_Etype (Def_Id, Etype (Elt)); + end if; + end; -- For a predefined container, The type of the loop variable is -- the Iterator_Element aspect of the container type. |