From 1e7bc06555257c73282c7ca1678a74d2cc6c7e6c Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Mon, 14 Oct 2013 15:31:52 +0200 Subject: [multiple changes] 2013-10-14 Robert Dewar * exp_prag.adb: Minor reformatting. 2013-10-14 Ed Schonberg * sem_case.adb (Check_Against_Predicate): Handle properly an others clause in various cases. 2013-10-14 Hristian Kirtchev * sem_prag.adb (Check_Matching_Constituent): Do not inspect the hidden states if there are no hidden states. This case arises when the constituents are states coming from a private child. 2013-10-14 Doug Rupp * init.c [ARMEL and VxWorks] (__gnat_map_signal): Re-arm guard page by clearing VALID bit vice setting page protection. 2013-10-14 Arnaud Charlet * gnat_rm.texi, adaint.c: Fix typo. 2013-10-14 Ed Schonberg * sem_util.adb (Is_Variable, In_Protected_Function): In the body of a protected function, the protected object itself is a constant (not just its components). From-SVN: r203550 --- gcc/ada/sem_case.adb | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'gcc/ada/sem_case.adb') diff --git a/gcc/ada/sem_case.adb b/gcc/ada/sem_case.adb index 68ac66a..33f2977 100644 --- a/gcc/ada/sem_case.adb +++ b/gcc/ada/sem_case.adb @@ -319,8 +319,16 @@ package body Sem_Case is -- ^ illegal ^ elsif Pred_Lo < Choice_Lo and then Pred_Hi < Choice_Lo then - Missing_Choice (Pred_Lo, Pred_Hi); - Error := True; + if Others_Present then + + -- Current predicate set is covered by others clause. + + null; + + else + Missing_Choice (Pred_Lo, Pred_Hi); + Error := True; + end if; -- There may be several static predicate sets between the current -- one and the choice. Inspect the next static predicate set. @@ -384,7 +392,12 @@ package body Sem_Case is if Others_Present then Prev_Lo := Choice_Lo; Prev_Hi := Choice_Hi; - Next (Pred); + + -- Check whether predicate set is fully covered by choice + + if Pred_Hi = Choice_Hi then + Next (Pred); + end if; -- Choice_Lo Choice_Hi Pred_Hi -- +===========+===========+ -- cgit v1.1