From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7871) id 7A4B0385B50F; Thu, 5 Jan 2023 14:39:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7A4B0385B50F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672929556; bh=TPn+h+QJtPmiwvWF3B9tSxtdlfRQM6ANTsYx2oRpcdo=; h=From:To:Subject:Date:From; b=DdW14cMqpw3s2+OZpHWFRTqxZJw/Hn4br7wivQHyvjER8f6FoVRDlcvRbknk9mrir ZgS2gzK6yakW+zguFplrSKSb83IzW7mY/owbivDhfimlxIf1OR1jOu83lHrbuwR3UN kG75JW9QHQmapjPcy3Gpp+mx+rV1quQIyWGrJimw= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" From: Marc Poulhi?s To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-5026] ada: Fix nested generic instantiation X-Act-Checkin: gcc X-Git-Author: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Git-Refname: refs/heads/master X-Git-Oldrev: 3f7776ea33a6ba9dac28bff8a521de04a728e19f X-Git-Newrev: 07facb98ed0db8771fd36e6c73921177c11b18ea Message-Id: <20230105143916.7A4B0385B50F@sourceware.org> Date: Thu, 5 Jan 2023 14:39:16 +0000 (GMT) List-Id: https://gcc.gnu.org/g:07facb98ed0db8771fd36e6c73921177c11b18ea commit r13-5026-g07facb98ed0db8771fd36e6c73921177c11b18ea Author: Marc Poulhiès Date: Wed Dec 21 10:29:38 2022 +0100 ada: Fix nested generic instantiation Previous fix for generic instantiation was not precise enough and could wrongly assume the instantiation node to be an N_Expanded_Name. gcc/ada/ * sem_ch12.adb (Instantiate_Package_Body): Better filtering when installing parent on the scope stack. Diff: --- gcc/ada/sem_ch12.adb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 0f2dd39b53c..1755549bd8b 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -12182,6 +12182,9 @@ package body Sem_Ch12 is elsif Ekind (Scope (Gen_Unit)) = E_Generic_Package and then Ekind (Scope (Act_Decl_Id)) = E_Package and then Is_Generic_Instance (Scope (Act_Decl_Id)) + and then Nkind + (Name (Get_Unit_Instantiation_Node + (Scope (Act_Decl_Id)))) = N_Expanded_Name then Par_Ent := Entity (Prefix (Name (Get_Unit_Instantiation_Node