summaryrefslogtreecommitdiffstats
path: root/gcc/ada/sem_ch5.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-01 15:13:25 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-01 15:13:25 +0000
commit0a0eba553a97ad5d5c153bd1f0ad14f9a2efd5df (patch)
treef2a6bb372c9048c9925ba8b26c7e25266961f2d4 /gcc/ada/sem_ch5.adb
parenta94a61dfd9be927e7adf6a2898dbc3a4693b66ea (diff)
downloadppe42-gcc-0a0eba553a97ad5d5c153bd1f0ad14f9a2efd5df.tar.gz
ppe42-gcc-0a0eba553a97ad5d5c153bd1f0ad14f9a2efd5df.zip
2011-08-01 Thomas Quinot <quinot@adacore.com>
* sem_ch6.adb (Enter_Overloaded_Entity): Do not warn about a declaration being hidden when overriding an implicit inherited subprogram. * par-ch10.adb (P_Compilation_Unit): In syntax check only mode (-gnats), do not complain about a source file that contains only a pragma No_Body. 2011-08-01 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Iterator_Scheme): Do not overwrite type of loop variable if already set. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177046 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch5.adb')
-rw-r--r--gcc/ada/sem_ch5.adb11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index 90a6926f579..96c778d3f83 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -1947,7 +1947,16 @@ package body Sem_Ch5 is
Make_Index (DS, LP);
Set_Ekind (Id, E_Loop_Parameter);
- Set_Etype (Id, Etype (DS));
+
+ -- If the loop is part of a predicate or precondition, it may
+ -- be analyzed twice, once in the source and once on the copy
+ -- used to check conformance. Preserve the original itype
+ -- because the second one may be created in a different scope,
+ -- e.g. a precondition procedure, leading to a crash in GIGI.
+
+ if No (Etype (Id)) or else Etype (Id) = Any_Type then
+ Set_Etype (Id, Etype (DS));
+ end if;
-- Treat a range as an implicit reference to the type, to
-- inhibit spurious warnings.
OpenPOWER on IntegriCloud