aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch3.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2017-01-12 15:42:42 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2017-01-12 15:42:42 +0100
commit0289a8d7ef1288cc9b2be36b3080981c9fac839e (patch)
treea42b6be679d4996088b2a19352ff0f10c6e31a63 /gcc/ada/sem_ch3.adb
parent2168d7cc3ba6f3b2280bfefcc8a789ea4d8d90a5 (diff)
downloadgcc-0289a8d7ef1288cc9b2be36b3080981c9fac839e.zip
gcc-0289a8d7ef1288cc9b2be36b3080981c9fac839e.tar.gz
gcc-0289a8d7ef1288cc9b2be36b3080981c9fac839e.tar.bz2
[multiple changes]
2017-01-12 Ed Schonberg <schonberg@adacore.com> * sem_attr.adb (Analyze_Attribute_Reference, case Loop_Entry): Hnadle properly the attribute reference when it appears as part of an expression in another loop aspect. 2017-01-12 Ed Schonberg <schonberg@adacore.com> * exp_ch3.adb (Check_Predicated_Discriminant): New procedure, subsidiary of Build_Initialization_Call, to complete generation of predicate checks on discriminants whose (sub)types have predicates, and to add checks on variants that do not have an others clause. * sem_util.adb (Gather_Components): A missing Others alternative is not an error when the type of the discriminant is a static predicate (and coverage has been checked when analyzing the case statement). A runtime check is generated to verify that a given discriminant satisfies the predicate (RM 3.8.1. (21.1/2)). 2017-01-12 Yannick Moy <moy@adacore.com> * gnat1drv.adb (Adjust_Global_Switches): Only perform checking of exception mechanism when generating code. 2017-01-12 Justin Squirek <squirek@adacore.com> * exp_ch7.adb (Add_Type_Invariants, Process_Array_Component): Remove handling of access component with invariant. (Build_Invariant_Procedure_Declaration): Remove return on class wide type. * freeze.adb (Freeze_Array_Type, Freeze_Record_Type): Remove conditional exception for component or array so Has_Own_Invariants flag is not falsly set. * sem_ch3.adb (Make_Class_Wide_Type): Initialize copy of class wide type to have no invariant flags. From-SVN: r244366
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r--gcc/ada/sem_ch3.adb6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index e0520a9..512615f 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -18307,7 +18307,8 @@ package body Sem_Ch3 is
Set_Freeze_Node (CW_Type, Empty);
-- Customize the class-wide type: It has no prim. op., it cannot be
- -- abstract and its Etype points back to the specific root type.
+ -- abstract, its Etype points back to the specific root type, and it
+ -- cannot have any invariants.
Set_Ekind (CW_Type, E_Class_Wide_Type);
Set_Is_Tagged_Type (CW_Type, True);
@@ -18316,6 +18317,9 @@ package body Sem_Ch3 is
Set_Is_Constrained (CW_Type, False);
Set_Is_First_Subtype (CW_Type, Is_First_Subtype (T));
Set_Default_SSO (CW_Type);
+ Set_Has_Inheritable_Invariants (CW_Type, False);
+ Set_Has_Inherited_Invariants (CW_Type, False);
+ Set_Has_Own_Invariants (CW_Type, False);
if Ekind (T) = E_Class_Wide_Subtype then
Set_Etype (CW_Type, Etype (Base_Type (T)));