]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Couple of minor fixes for build-in-place calls in anonymous contexts
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 19 Nov 2025 08:45:05 +0000 (09:45 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 27 Nov 2025 12:57:44 +0000 (13:57 +0100)
commit12db40e076ae780edb1a022c22f5259f9a7dfa42
tree6fb0cd1163bf897f99dfc12d635e9c458faa11af
parent7a7eadc2dfa1c463958f5f7218d76231ffe79d84
ada: Couple of minor fixes for build-in-place calls in anonymous contexts

The current code does not deal with all the anonymous contexts uniformly,
since it potentially creates an activation chain and a master only in the
case of an actual in a call; moreover, the master is created in the scope
of the actual's type, instead of in the context of the call like the chain.

The change also aligns Make_Build_In_Place_Call_In_Anonymous_Context with
sibling routines by calling Make_Build_In_Place_Call_In_Object_Declaration
directly instead of letting the expander recursively do it.  It also adds
a missing rewriting in Make_Build_In_Place_Iface_Call_In_Anonymous_Context.

gcc/ada/ChangeLog:

* exp_ch6.adb (Expand_Actuals): Do not create activation chain and
master for build-in-place calls here but...
(Make_Build_In_Place_Call_In_Allocator): Use Unqual_Conv.
(Make_Build_In_Place_Call_In_Anonymous_Context): ...here instead.
Call Make_Build_In_Place_Call_In_Object_Declaration directly.
(Make_Build_In_Place_Iface_Call_In_Anonymous_Context): ...and here
instead.  Add missing rewriting of the call.
gcc/ada/exp_ch6.adb