+2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
+
+ * sem_ch7.adb (Has_Referencer): Add comment for the
+ N_Freeze_Entity case. Do not rely on
+ Has_Referencer_Of_Non_Subprograms to clear the Is_Public flag on
+ subprogram entities.
+
2018-10-09 Ed Schonberg <schonberg@adacore.com>
* exp_unst.adb (In_Synchronized_Call): Handle properly private
Discard : Boolean;
pragma Unreferenced (Discard);
begin
- -- Inspect the actions to find references to subprograms
+ -- Inspect the actions to find references to subprograms.
+ -- We assume that the actions do not contain other kinds
+ -- of references and, therefore, we do not stop the scan
+ -- or set Has_Referencer_Of_Non_Subprograms here. Doing
+ -- it would pessimize common cases for which the actions
+ -- contain the declaration of an init procedure, since
+ -- such a procedure is automatically marked inline.
Discard :=
Has_Referencer (Actions (Decl),
and then not Is_Exported (Decl_Id)
and then No (Interface_Name (Decl_Id))
and then
- (not Has_Referencer_Of_Non_Subprograms
+ ((Nkind (Decl) /= N_Subprogram_Declaration
+ and then not Has_Referencer_Of_Non_Subprograms)
or else (Nkind (Decl) = N_Subprogram_Declaration
and then not Subprogram_Table.Get (Decl_Id)))
then
+2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/inline14.adb, gnat.dg/inline14_pkg.adb,
+ gnat.dg/inline14_pkg.ads: New testcase.
+
2018-10-09 Ed Schonberg <schonberg@adacore.com>
* gnat.dg/warn18.adb: New testcase.
--- /dev/null
+package body Inline14_Pkg is
+
+ I : Integer;
+
+ generic procedure Inner;
+
+ procedure Inner is
+ begin
+ I := 0;
+ end;
+
+ procedure My_Inner is new Inner;
+
+ procedure Proc renames My_Inner;
+
+end Inline14_Pkg;