summaryrefslogtreecommitdiff
path: root/gcc/ada/atree.ads
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2021-02-13 16:43:22 -0500
committerPierre-Marie de Rodat <derodat@adacore.com>2021-06-15 06:19:10 -0400
commita5db70e78af095a3d8e4744f21059448056fa47b (patch)
tree7eb2485f98fc8116b71f74a47df1f648e323a043 /gcc/ada/atree.ads
parented17bbe3c3ac0a5afd866030d88dce3f6d5a2730 (diff)
downloadgcc-a5db70e78af095a3d8e4744f21059448056fa47b.tar.gz
[Ada] Fix bug in subtype of private type with invariants
gcc/ada/ * sem_util.adb (Propagate_Invariant_Attributes): Call Set_Has_Own_Invariants on the base type, because these are Base_Type_Only. The problem is that the base type of a type is indeed a base type when Set_Base_Type is called, but then the type is mutated into a subtype in rare cases. * atree.ads, atree.adb (Is_Entity): Export. Correct subtype of parameter in body. * gen_il-gen.adb: Improve getters so that "Pre => ..." can refer to the value of the field. Put Warnings (Off) on some with clauses that are not currently used, but might be used by such Pre's.
Diffstat (limited to 'gcc/ada/atree.ads')
-rw-r--r--gcc/ada/atree.ads4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/ada/atree.ads b/gcc/ada/atree.ads
index e2d3492e32f..c814c80cefa 100644
--- a/gcc/ada/atree.ads
+++ b/gcc/ada/atree.ads
@@ -222,6 +222,10 @@ package Atree is
-- Called to unlock node modifications when assertions are enabled; if
-- assertions are not enabled calling this subprogram has no effect.
+ function Is_Entity (N : Node_Or_Entity_Id) return Boolean;
+ pragma Inline (Is_Entity);
+ -- Returns True if N is an entity
+
function New_Node
(New_Node_Kind : Node_Kind;
New_Sloc : Source_Ptr) return Node_Id;