]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix spurious error on Ada 2022 declare expression of limited type master trunk
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 9 Jun 2026 09:11:54 +0000 (11:11 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 19 Jun 2026 13:05:30 +0000 (15:05 +0200)
commit3b0af59dc9e67f5161e0ac6a867429f6fd40308e
treefcd0003474d7872effea10494518f840898fcc34
parente08b7d7ceba7bd3c794fda0c5cbbdcc138d3aad3
ada: Fix spurious error on Ada 2022 declare expression of limited type

The underlying problem is that declare expressions are implemented by means
of a temporary in most cases and that's incompatible with limited types.

gcc/ada/ChangeLog:

* exp_ch4.adb (Expand_N_Expression_With_Actions): Create a temporary
only for types that can be copied, and replace the EWA node by its
expression for other types.
* exp_ch6.adb (Expand_Ctrl_Function_Call): Bail out when the parent
is an EWA node.
* sem_ch3.adb (OK_For_Limited_Init_In_05): Recurse on the expression
of an EWA node.
gcc/ada/exp_ch4.adb
gcc/ada/exp_ch6.adb
gcc/ada/sem_ch3.adb