From 23b863538f26031f15580c4001ea7e2ffe007855 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Tue, 26 Oct 2010 12:51:36 +0200 Subject: [multiple changes] 2010-10-26 Ed Schonberg * 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 * 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 * sem_prag.adb, sem_cat.ads: Minor reformatting. 2010-10-26 Sergey Rybin * vms_data.ads: Define VMS qualifier for gnatelim '--ignore' option 2010-10-26 Thomas Quinot * 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 * 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 --- gcc/ada/sem_case.adb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'gcc/ada/sem_case.adb') 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); -- cgit v1.1