aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/aspects.ads
diff options
context:
space:
mode:
authorSteve Baird <baird@adacore.com>2020-08-06 11:09:50 -0700
committerPierre-Marie de Rodat <derodat@adacore.com>2020-10-22 08:11:26 -0400
commit7b3bda2ce269e858b2a7defa904bc748bc0b5854 (patch)
treeec0d6059aeaa428ddbe569bf418f38d6da40da41 /gcc/ada/aspects.ads
parent944fed738c3f300b4e3cf5f89a4d2b40c85e0a75 (diff)
downloadgcc-7b3bda2ce269e858b2a7defa904bc748bc0b5854.zip
gcc-7b3bda2ce269e858b2a7defa904bc748bc0b5854.tar.gz
gcc-7b3bda2ce269e858b2a7defa904bc748bc0b5854.tar.bz2
[Ada] AI12-0211: Consistency of inherited nonoverridable aspects
gcc/ada/ * aspects.ads: Introduce the subtype Nonoverridable_Aspect_Id, whose Static_Predicate reflects the list of nonoverridable aspects given in Ada RM 13.1.1(18.7). * sem_util.ads, sem_util.adb: Add two new visible subprograms, Check_Inherited_Nonoverridable_Aspects and Is_Confirming. The former is used to check the consistency of inherited nonoverridable aspects from multiple sources. The latter indicates whether two aspect specifications for a nonoverridable aspect are confirming. Because of compatibility concerns in compiling QGen, Is_Confirming always returns True if Relaxed_RM_Semantics (i.e., -gnatd.M) is specified. * sem_ch3.adb (Derived_Type_Declaration): Call new Check_Inherited_Nonoverridable_Aspects procedure if interface list is non-empty. * sem_ch9.adb (Check_Interfaces): Call new Check_Inherited_Nonoverridable_Aspects procedure if interface list is non-empty. * sem_ch13.adb (Analyze_Aspect_Specifications): When an explicit aspect specification overrides an inherited nonoverridable aspect, check that the explicit specification is confirming.
Diffstat (limited to 'gcc/ada/aspects.ads')
-rw-r--r--gcc/ada/aspects.ads10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/ada/aspects.ads b/gcc/ada/aspects.ads
index d893100..425d210 100644
--- a/gcc/ada/aspects.ads
+++ b/gcc/ada/aspects.ads
@@ -229,6 +229,16 @@ package Aspects is
Aspect_Id range Aspect_Id'Succ (No_Aspect) .. Aspect_Id'Last;
-- Aspect_Id's excluding No_Aspect
+ subtype Nonoverridable_Aspect_Id is Aspect_Id with
+ Static_Predicate => Nonoverridable_Aspect_Id in
+ Aspect_Default_Iterator | Aspect_Iterator_Element |
+ Aspect_Implicit_Dereference | Aspect_Constant_Indexing |
+ Aspect_Variable_Indexing | Aspect_Aggregate |
+ Aspect_Max_Entry_Queue_Length
+ -- | Aspect_No_Controlled_Parts
+ -- ??? No_Controlled_Parts not yet in Aspect_Id enumeration
+ ; -- see RM 13.1.1(18.7)
+
-- The following array indicates aspects that accept 'Class
Class_Aspect_OK : constant array (Aspect_Id) of Boolean :=