aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch7.adb
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2019-12-13 09:04:06 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-12-13 09:04:06 +0000
commit7f8ad8f001a4054e07b7d0762a14a6784bec136c (patch)
tree3f4c5b4ac48acb6b99ac7042351e300056d58f97 /gcc/ada/sem_ch7.adb
parent0a8ff576dbd2806fef992e52e1148a84dabebe5d (diff)
downloadgcc-7f8ad8f001a4054e07b7d0762a14a6784bec136c.zip
gcc-7f8ad8f001a4054e07b7d0762a14a6784bec136c.tar.gz
gcc-7f8ad8f001a4054e07b7d0762a14a6784bec136c.tar.bz2
[Ada] Crash on inherited private operation in child package
2019-12-13 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_ch7.adb (Analyze_Package_Body_Helper): Do not call Declare_Inherited_Private_Subprograms on s child body: the required operations have already been created when analyzing the corresponding package declaration. This prevents a redeclaration of inehrited operation, and a crash when inserting the new operation in the current scope. From-SVN: r279349
Diffstat (limited to 'gcc/ada/sem_ch7.adb')
-rw-r--r--gcc/ada/sem_ch7.adb3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb
index 313cb4e..6d9a1db 100644
--- a/gcc/ada/sem_ch7.adb
+++ b/gcc/ada/sem_ch7.adb
@@ -925,9 +925,12 @@ package body Sem_Ch7 is
-- This is a nested package, so it may be necessary to declare certain
-- inherited subprograms that are not yet visible because the parent
-- type's subprograms are now visible.
+ -- Note that for child units these operations were generated when
+ -- analyzing the package specification.
if Ekind (Scope (Spec_Id)) = E_Package
and then Scope (Spec_Id) /= Standard_Standard
+ and then not Is_Child_Unit (Spec_Id)
then
Declare_Inherited_Private_Subprograms (Spec_Id);
end if;