diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/exp_util.adb | 20 | ||||
-rw-r--r-- | gcc/ada/exp_util.ads | 4 |
2 files changed, 23 insertions, 1 deletions
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index b032336..a4aa5f6 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -6500,6 +6500,16 @@ package body Exp_Util is then Top := Par; + -- Stop at contexts where temporaries may be contained + + elsif Nkind (Par) in N_Aggregate + | N_Delta_Aggregate + | N_Extension_Aggregate + | N_Block_Statement + | N_Loop_Statement + then + exit; + -- Prevent the search from going too far elsif Is_Body_Or_Package_Declaration (Par) then @@ -14222,6 +14232,16 @@ package body Exp_Util is then return True; + -- Stop at contexts where temporaries may be contained + + elsif Nkind (Par) in N_Aggregate + | N_Delta_Aggregate + | N_Extension_Aggregate + | N_Block_Statement + | N_Loop_Statement + then + return False; + -- Prevent the search from going too far elsif Is_Body_Or_Package_Declaration (Par) then diff --git a/gcc/ada/exp_util.ads b/gcc/ada/exp_util.ads index 66c4dc6..24065b6 100644 --- a/gcc/ada/exp_util.ads +++ b/gcc/ada/exp_util.ads @@ -1240,7 +1240,9 @@ package Exp_Util is -- extension to verify legality rules on inherited conditions. function Within_Case_Or_If_Expression (N : Node_Id) return Boolean; - -- Determine whether arbitrary node N is within a case or an if expression + -- Determine whether arbitrary node N is immediately within a case or an if + -- expression. The criterion is whether temporaries created by the actions + -- attached to N need to outlive an enclosing case or if expression. private pragma Inline (Duplicate_Subexpr); |