]> gcc.gnu.org Git - gcc.git/blobdiff - gcc/ada/exp_util.adb
[multiple changes]
[gcc.git] / gcc / ada / exp_util.adb
index 72831936483ac0a2ee507253e4b1a8a88bff6743..2fd4e446244ad07337aa7e85073a15dd09c11796 100644 (file)
@@ -2696,6 +2696,15 @@ package body Exp_Util is
             then
                return True;
 
+            elsif Is_Access_Type (Obj_Typ)
+              and then Present (Return_Flag_Or_Transient_Decl (Obj_Id))
+              and then Nkind (Return_Flag_Or_Transient_Decl (Obj_Id)) =
+                         N_Object_Declaration
+              and then Is_Finalizable_Transient
+                         (Return_Flag_Or_Transient_Decl (Obj_Id), Decl)
+            then
+               return True;
+
             --  Simple protected objects which use type System.Tasking.
             --  Protected_Objects.Protection to manage their locks should be
             --  treated as controlled since they require manual cleanup.
@@ -2732,7 +2741,7 @@ package body Exp_Util is
 
             elsif Needs_Finalization (Obj_Typ)
               and then Is_Return_Object (Obj_Id)
-              and then Present (Return_Flag (Obj_Id))
+              and then Present (Return_Flag_Or_Transient_Decl (Obj_Id))
             then
                return True;
             end if;
This page took 0.035366 seconds and 5 git commands to generate.