aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_case.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2013-10-14 15:31:52 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2013-10-14 15:31:52 +0200
commit1e7bc06555257c73282c7ca1678a74d2cc6c7e6c (patch)
tree83de5b6633cd5a5aeabf422cb2244eb93481f494 /gcc/ada/sem_case.adb
parent5644b7e8e7fcc55fe544949c58ce049039e671c9 (diff)
downloadgcc-1e7bc06555257c73282c7ca1678a74d2cc6c7e6c.zip
gcc-1e7bc06555257c73282c7ca1678a74d2cc6c7e6c.tar.gz
gcc-1e7bc06555257c73282c7ca1678a74d2cc6c7e6c.tar.bz2
[multiple changes]
2013-10-14 Robert Dewar <dewar@adacore.com> * exp_prag.adb: Minor reformatting. 2013-10-14 Ed Schonberg <schonberg@adacore.com> * sem_case.adb (Check_Against_Predicate): Handle properly an others clause in various cases. 2013-10-14 Hristian Kirtchev <kirtchev@adacore.com> * 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 <rupp@adacore.com> * 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 <charlet@adacore.com> * gnat_rm.texi, adaint.c: Fix typo. 2013-10-14 Ed Schonberg <schonberg@adacore.com> * 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
Diffstat (limited to 'gcc/ada/sem_case.adb')
-rw-r--r--gcc/ada/sem_case.adb19
1 files changed, 16 insertions, 3 deletions
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
-- +===========+===========+