From: Ed Schonberg Date: Sun, 24 Jan 2021 18:18:28 +0000 (-0500) Subject: [Ada] Spurious error on protected call in inherited postcondition X-Git-Tag: basepoints/gcc-13~7729 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9f0d76eca6b9f9b9d451e889dad28f22885fd1a3;p=thirdparty%2Fgcc.git [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. --- diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index 2955fd7f4986..30e1aff37b22 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