Commit 7f8ad8f0 by Ed Schonberg Committed by Pierre-Marie de Rodat

[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
parent 0a8ff576
2019-12-13 Ed Schonberg <schonberg@adacore.com>
* 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.
2019-12-13 Yannick Moy <moy@adacore.com>
* sem_prag.adb (Analyze_Depends_In_Decl_Part,
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment