From bb9c600b570e96332a06075f74affc3f51abe393 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Tue, 15 May 2012 11:37:57 +0200 Subject: [multiple changes] 2012-05-15 Ed Schonberg * sem_eval.adb (Subtypes_Statically_Match): In Ada 2012, static matching requires matching of static subtype predicates as well. 2012-05-15 Ed Schonberg * 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 * 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 * gnat_ugn.texi: gnatmetric: add a small example that demonstrates the difference between control coupling and unit coupling. 2012-05-15 Tristan Gingold * 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 --- gcc/ada/sem_case.adb | 12 +++++++++++- 1 file changed, 11 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 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; -- cgit v1.1