[Ada] Spurious elaboration issue due to inlining
This patch ensures that the full compilation context is captured prior
to package or subprogram instantiation/inlining and restored after the
action takes place.
2018-09-26 Hristian Kirtchev <kirtchev@adacore.com>
gcc/ada/
* sem_ch12.adb (Instantiate_Package_Body): Capture and restore
the full compilation context.
(Instantiate_Subprogram_Body): Capture and restore the full
compilation context.
gcc/testsuite/
* gnat.dg/elab7.adb, gnat.dg/elab7_pkg1.adb,
gnat.dg/elab7_pkg1.ads, gnat.dg/elab7_pkg2.adb,
gnat.dg/elab7_pkg2.ads: New testcase.
From-SVN: r264630