]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Spurious elaboration issue due to inlining
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 26 Sep 2018 09:19:28 +0000 (09:19 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 26 Sep 2018 09:19:28 +0000 (09:19 +0000)
commitc80aa5fbc61647b785e62582259e98196939f9cd
tree0358e2c62d3402b7a22eb399e9c80779b756d4c1
parent4dad74110404ba3fb838b5e6b50e7e9a86a1c075
[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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264630 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ada/ChangeLog
gcc/ada/sem_ch12.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/elab7.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/elab7_pkg1.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/elab7_pkg1.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/elab7_pkg2.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/elab7_pkg2.ads [new file with mode: 0644]