]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Add ctor call after address clause
authorAlexandre Oliva <oliva@adacore.com>
Wed, 1 Oct 2025 14:59:18 +0000 (11:59 -0300)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 3 Nov 2025 14:15:15 +0000 (15:15 +0100)
commit77691b9ff59fbf87ad70c3f2b6fad41ee469f078
treeb0df33bae365f7083b8756a89cd2975f09a832fb
parent966d132b0a59d2285e5546243907f4eec81e2dce
ada: Add ctor call after address clause

An object initialized by a C++-imported constructor call has the
constructor function call transformed into a procedure call, and the
call is inserted after the object declaration.

If the object has say an address clause, that transformation separates
the declaration from the address clause, causing the translation of
the call to fail.

Keep such clauses next to the declaration by inserting the constructor
procedure call after them.

gcc/ada/ChangeLog:

* exp_ch3.adb (Expand_N_Object_Declaration): Insert ctor call
after representation clauses.
gcc/ada/exp_ch3.adb