diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2022-12-14 15:16:21 +0100 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-01-05 15:29:57 +0100 |
commit | d990f34e93172b040de29c65e6d72572e73d00f0 (patch) | |
tree | 3490300fc2b7f62e0c2329ab1f93c43e93132241 /gcc/rust/resolve/rust-ast-resolve-expr.cc | |
parent | 46924ad780665721a51306a646f7f601c359ba4c (diff) | |
download | gcc-d990f34e93172b040de29c65e6d72572e73d00f0.zip gcc-d990f34e93172b040de29c65e6d72572e73d00f0.tar.gz gcc-d990f34e93172b040de29c65e6d72572e73d00f0.tar.bz2 |
ada: Fix finalization issues in extended return statements
The first issue pertains to return objects of (class-wide) interface types,
which need to be adjusted if the type is not inherently limited. The second
issue is for return objects of non-class-wide types that are initialized by
a function call, which can use a direct renaming only if the object doing
the capture of the function call is flagged by Is_Related_To_Func_Return.
The third one is that, in the second case, we may need to reassign the tag.
gcc/ada/
* exp_ch3.adb (Expand_N_Object_Declaration): For a special return
object of an interface type that is not inherently limited, make
a call to the Adjust primitive after doing the copy. For a special
return object of a non-class-wide type initialized by a function
call, use a direct renaming only if the object doing the capture
is flagged by Is_Related_To_Func_Return. For a special return
object using a direct renaming, reassign the tag, if need be.
* exp_ch6.adb (Expand_Simple_Function_Return): Fix comment.
* exp_util.adb (Is_Related_To_Func_Return): Accept both regular and
renaming object declarations for return objects.
Diffstat (limited to 'gcc/rust/resolve/rust-ast-resolve-expr.cc')
0 files changed, 0 insertions, 0 deletions