2018-05-30 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* exp_unst.adb: Search specification of main unit as well, for
unnesting.
From-SVN: r260928
+2018-05-30 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_unst.adb: Search specification of main unit as well, for
+ unnesting.
+
2018-05-30 Ed Schonberg <schonberg@adacore.com>
* exp_ch7.adb (Check_Unnesting_Elaboration_Code): The statement part of
return;
end if;
+ -- A specification will contain bodies if it contains instantiations
+ -- so examine package or subprogram declaration of the main unit,
+ -- when it is present.
+
+ if Nkind (Unit (N)) = N_Package_Body
+ or else (Nkind (Unit (N)) = N_Subprogram_Body
+ and then not Acts_As_Spec (N))
+ then
+ Do_Search (Library_Unit (N));
+ end if;
+
Do_Search (N);
end Unnest_Subprograms;