aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2021-01-24 13:18:28 -0500
committerPierre-Marie de Rodat <derodat@adacore.com>2021-05-07 05:28:51 -0400
commit9f0d76eca6b9f9b9d451e889dad28f22885fd1a3 (patch)
treee633bbd556ab763ecfaa130ef7b9e0978a30920c
parent92f372f00936a549de2cb9764eee722bb07959ba (diff)
downloadgcc-9f0d76eca6b9f9b9d451e889dad28f22885fd1a3.zip
gcc-9f0d76eca6b9f9b9d451e889dad28f22885fd1a3.tar.gz
gcc-9f0d76eca6b9f9b9d451e889dad28f22885fd1a3.tar.bz2
[Ada] Spurious error on protected call in inherited postcondition
gcc/ada/ * exp_util.adb (Build_Class_Wide_Expression, Replace_Entity): Add guard to verify that the enclosing pragma is a precondition.
-rw-r--r--gcc/ada/exp_util.adb1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index 2955fd7..30e1aff 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -1327,6 +1327,7 @@ package body Exp_Util is
and then Is_Primitive_Wrapper (New_E)
and then Is_Primitive_Wrapper (Subp)
and then Scope (Subp) = Scope (New_E)
+ and then Chars (Pragma_Identifier (Prag)) = Name_Precondition
then
Error_Msg_Node_2 := Wrapped_Entity (Subp);
Error_Msg_NE