aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_case.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2012-05-15 11:37:57 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2012-05-15 11:37:57 +0200
commitbb9c600b570e96332a06075f74affc3f51abe393 (patch)
tree0bf23f114d97e5a8f1413d50d35b32ce8ee4119f /gcc/ada/sem_case.adb
parentc4c768ddedd306d53d4b32166816c974c14e0f61 (diff)
downloadgcc-bb9c600b570e96332a06075f74affc3f51abe393.zip
gcc-bb9c600b570e96332a06075f74affc3f51abe393.tar.gz
gcc-bb9c600b570e96332a06075f74affc3f51abe393.tar.bz2
[multiple changes]
2012-05-15 Ed Schonberg <schonberg@adacore.com> * sem_eval.adb (Subtypes_Statically_Match): In Ada 2012, static matching requires matching of static subtype predicates as well. 2012-05-15 Ed Schonberg <schonberg@adacore.com> * sem_case.adb (Analyze_Choices): If the subtype of the expression has a non-static predicate, the case alternatives must cover the base type. 2012-05-15 Tristan Gingold <gingold@adacore.com> * a-calend-vms.ads: Add pragma export to Split and Time_Of. Merge comments from a-calend.ads to minimize differences. 2012-05-15 Sergey Rybin <rybin@adacore.com frybin> * gnat_ugn.texi: gnatmetric: add a small example that demonstrates the difference between control coupling and unit coupling. 2012-05-15 Tristan Gingold <gingold@adacore.com> * bindgen.adb (Gen_Header): Remove code to emit LE_Set. (Gen_Finalize_Library): Replace test with a call to __gnat_reraise_library_exception_if_any. * s-soflin.ads (Library_Exception): Do not export. (Library_Exception_Set): Likewise. * a-except-2005.ads, a-except-2005.adb (Reraise_Library_Exception_If_Any): New procedure. From-SVN: r187509
Diffstat (limited to 'gcc/ada/sem_case.adb')
-rw-r--r--gcc/ada/sem_case.adb12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/ada/sem_case.adb b/gcc/ada/sem_case.adb
index 1825cab..3e37440 100644
--- a/gcc/ada/sem_case.adb
+++ b/gcc/ada/sem_case.adb
@@ -803,8 +803,18 @@ package body Sem_Case is
-- bounds of its base type to determine the values covered by the
-- discrete choices.
+ -- In Ada 2012, if the subtype has a non-static predicate the full
+ -- range of the base type must be covered as well.
+
if Is_OK_Static_Subtype (Subtyp) then
- Bounds_Type := Subtyp;
+ if not Has_Predicates (Subtyp)
+ or else Present (Static_Predicate (Subtyp))
+ then
+ Bounds_Type := Subtyp;
+ else
+ Bounds_Type := Choice_Type;
+ end if;
+
else
Bounds_Type := Choice_Type;
end if;