From 9f0d76eca6b9f9b9d451e889dad28f22885fd1a3 Mon Sep 17 00:00:00 2001 From: Ed Schonberg Date: Sun, 24 Jan 2021 13:18:28 -0500 Subject: [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. --- gcc/ada/exp_util.adb | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc') 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 -- cgit v1.1