https://gcc.gnu.org/g:bd2462a8473b7ee7cabd4040553ae13606273723
commit r15-182-gbd2462a8473b7ee7cabd4040553ae13606273723 Author: Yannick Moy <m...@adacore.com> Date: Tue Dec 19 10:52:38 2023 +0100 ada: Fix detection of (Un)Hide_Info pragma in GNATprove mode Spec or body may not be in a list for subunit. gcc/ada/ * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Add guard. Diff: --- gcc/ada/inline.adb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index 98bed860760..b7a6cc90cd2 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -1819,6 +1819,7 @@ package body Inline is begin if Present (Spec_Id) + and then Is_List_Member (Unit_Declaration_Node (Spec_Id)) and then Has_Hide_Unhide_Pragma (Next (Unit_Declaration_Node (Spec_Id))) then @@ -1829,7 +1830,9 @@ package body Inline is Subp_Body : constant N_Subprogram_Body_Id := Unit_Declaration_Node (Body_Id); begin - return Has_Hide_Unhide_Pragma (Next (Subp_Body)) + return + (Is_List_Member (Subp_Body) + and then Has_Hide_Unhide_Pragma (Next (Subp_Body))) or else Has_Hide_Unhide_Pragma (First (Declarations (Subp_Body))); end;