From: Marc Poulhiès Date: Wed, 22 Mar 2023 09:43:07 +0000 (+0100) Subject: ada: Fix restoration of parent link X-Git-Tag: basepoints/gcc-15~8822 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c33d93bfe8582375d4e56faebb911854517a9f3;p=thirdparty%2Fgcc.git ada: Fix restoration of parent link When resetting the parent link after having restored the selected component node, the assertion used was incorrectly triggered when the traversal hits the members of the parameters association list, as in: This.Some_Func (Param1, Param2).Dispatching_Call When restoring the selected component for Dispatching_Call, the assertion was wrongly triggered when passed Param1 and Param2. gcc/ada/ * contracts.adb (Restore_Original_Selected_Component): Adjust assertion. --- diff --git a/gcc/ada/contracts.adb b/gcc/ada/contracts.adb index 012ea33cf896..9d02887cfa12 100644 --- a/gcc/ada/contracts.adb +++ b/gcc/ada/contracts.adb @@ -4954,7 +4954,8 @@ package body Contracts is begin if Par /= Parent_Node then - pragma Assert (not Is_List_Member (Node)); + pragma Assert (not Is_List_Member (Node) + or else Nkind (Par) = N_Function_Call); Set_Parent (Node, Parent_Node); end if;