diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2020-04-05 23:37:18 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-06-16 09:07:14 -0400 |
commit | df7507a6373cf54b43b8884a54cbc8e4c4ea03bf (patch) | |
tree | 479fec017e0515d4e2f91860847b9c471f758fc3 | |
parent | 81c356975fc26ab5f9306bd9c596ef7232287fcb (diff) | |
download | gcc-df7507a6373cf54b43b8884a54cbc8e4c4ea03bf.zip gcc-df7507a6373cf54b43b8884a54cbc8e4c4ea03bf.tar.gz gcc-df7507a6373cf54b43b8884a54cbc8e4c4ea03bf.tar.bz2 |
[Ada] Force evaluation of operator calls in renamings
2020-06-16 Piotr Trojanek <trojanek@adacore.com>
gcc/ada/
* exp_util.adb (Evaluate_Name): Force evaluation of operators.
-rw-r--r-- | gcc/ada/exp_util.adb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index 471790e..47b4354 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -4953,9 +4953,11 @@ package body Exp_Util is when N_Explicit_Dereference => Force_Evaluation (Prefix (Nam)); - -- For a function call, we evaluate the call + -- For a function call, we evaluate the call; same for an operator - when N_Function_Call => + when N_Function_Call + | N_Op + => Force_Evaluation (Nam); -- For a qualified expression, we evaluate the underlying object @@ -4989,9 +4991,11 @@ package body Exp_Util is when N_Type_Conversion => Evaluate_Name (Expression (Nam)); - -- The remaining cases are direct name, operator symbol and character - -- literal. In all these cases, we do nothing, since we want to - -- reevaluate each time the renamed object is used. + -- The remaining cases are direct name and character literal. In all + -- these cases, we do nothing, since we want to reevaluate each time + -- the renamed object is used. ??? There are more remaining cases, at + -- least in the GNATprove_Mode, where this routine is called in more + -- contexts than in GNAT. when others => null; |