]> gcc.gnu.org Git - gcc.git/commit
ada: Fix detection of function calls in object declarations
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 6 Dec 2022 23:56:43 +0000 (00:56 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 3 Jan 2023 09:29:53 +0000 (10:29 +0100)
commit7caa68418199bf2116467780d68ba21d49c45cdb
treecbf01c8d5ab9af464d90543a754051d2b499397c
parent7512dcc94236d247ceef8cef6d36392a86e271a0
ada: Fix detection of function calls in object declarations

The current code has relied on Original_Node to detect rewritten function
calls in object declarations but that's not robust enough in the presence
of function calls written in object notation.

gcc/ada/

* exp_util.ads (Is_Captured_Function_Call): Declare.
* exp_util.adb (Is_Captured_Function_Call): New predicate.
* exp_ch3.adb (Expand_N_Object_Declaration): Use it to detect a
rewritten function call as the initializing expression.
* exp_ch6.adb (Expand_Simple_Function_Return): Use it to detect a
rewritten function call as the returned expression.
gcc/ada/exp_ch3.adb
gcc/ada/exp_ch6.adb
gcc/ada/exp_util.adb
gcc/ada/exp_util.ads
This page took 0.054091 seconds and 5 git commands to generate.