OSDN Git Service

2011-08-30 Jose Ruiz <ruiz@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / sem_ch5.adb
index 2571073..b576ba8 100644 (file)
@@ -2250,15 +2250,11 @@ package body Sem_Ch5 is
          Analyze (Subt);
       end if;
 
-      --  If it is an expression, the name is pre-analyzed in the caller.
-      --  If it it of a controlled type we need a block for the finalization
-      --  actions. As for loop bounds that need finalization, we create a
-      --  declaration and an assignment to trigger these actions.
-
-      if Present (Etype (Iter_Name))
-        and then Is_Controlled (Etype (Iter_Name))
-        and then not Is_Entity_Name (Iter_Name)
-      then
+      --  If the domain of iteration is an expression, create a declaration
+      --  for it, so that finalization actions are introduced outside of the
+      --  loop.
+
+      if not Is_Entity_Name (Iter_Name) then
          declare
             Id : constant Entity_Id := Make_Temporary (Loc, 'R', Iter_Name);