diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2010-10-26 12:51:36 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2010-10-26 12:51:36 +0200 |
commit | 23b863538f26031f15580c4001ea7e2ffe007855 (patch) | |
tree | 18198c3c3acb15ac21e0afb21a4944b9efeb0f2a /gcc/ada/sem_case.adb | |
parent | 8bead36ac96fc93efd792d95dd5560b4db8c5200 (diff) | |
download | gcc-23b863538f26031f15580c4001ea7e2ffe007855.zip gcc-23b863538f26031f15580c4001ea7e2ffe007855.tar.gz gcc-23b863538f26031f15580c4001ea7e2ffe007855.tar.bz2 |
[multiple changes]
2010-10-26 Ed Schonberg <schonberg@adacore.com>
* sem_ch5.adb (Analyze_Iteration_Scheme): Diagnose attempt to use thew
form "for X in A" when A is an array object. This form is only intended
for containers.
* sem_eval.adb: Fix reference to non-existing field of type conversion
node.
* sem_case.adb (Check_Choices): Improve error reporting for overlapping
choices in case statements.
2010-10-26 Gary Dismukes <dismukes@adacore.com>
* exp_disp.adb (Expand_Interface_Actuals): When expanding an actual for
a class-wide interface formal that involves applying a displacement
conversion to the actual, check for the case of calling a build-in-place
function and handle generation of the implicit BIP parameters (call
Make_Build_In_Place_Call_In_Anonymous_Context).
Add with and use of Exp_Ch6.
2010-10-26 Robert Dewar <dewar@adacore.com>
* sem_prag.adb, sem_cat.ads: Minor reformatting.
2010-10-26 Sergey Rybin <rybin@adacore.com>
* vms_data.ads: Define VMS qualifier for gnatelim '--ignore' option
2010-10-26 Thomas Quinot <quinot@adacore.com>
* sem_util.adb (Has_Preelaborable_Initialization.Check_Components):
For a discriminant, use Discriminant_Default_Value rather than
Expression (Declaration_Node (D)).
2010-10-26 Geert Bosch <bosch@adacore.com>
* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Parameterized
expressions don't need a spec, even when style checks require
subprograms to have one.
From-SVN: r165941
Diffstat (limited to 'gcc/ada/sem_case.adb')
-rw-r--r-- | gcc/ada/sem_case.adb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ada/sem_case.adb b/gcc/ada/sem_case.adb index fd601c5..ead21f4 100644 --- a/gcc/ada/sem_case.adb +++ b/gcc/ada/sem_case.adb @@ -313,9 +313,17 @@ package body Sem_Case is Hi := Expr_Value (Choice_Table (J).Hi); if Lo <= Prev_Hi then - Prev_Choice := Choice_Table (J - 1).Node; Choice := Choice_Table (J).Node; + -- Find first previous choice that overlaps. + + for K in 1 .. J - 1 loop + if Lo <= Expr_Value (Choice_Table (K).Hi) then + Prev_Choice := Choice_Table (K).Node; + exit; + end if; + end loop; + if Sloc (Prev_Choice) <= Sloc (Choice) then Error_Msg_Sloc := Sloc (Prev_Choice); Error_Msg_N ("duplication of choice value#", Choice); |