summaryrefslogtreecommitdiff
path: root/gcc/ada/inline.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/inline.adb')
-rw-r--r--gcc/ada/inline.adb18
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb
index b96da453496..7ca0e31d7e1 100644
--- a/gcc/ada/inline.adb
+++ b/gcc/ada/inline.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -467,6 +467,22 @@ package body Inline is
return;
end if;
+ -- If the instance appears within a generic subprogram there is nothing
+ -- to finalize either.
+
+ declare
+ S : Entity_Id;
+ begin
+ S := Scope (Inst);
+ while Present (S) and then S /= Standard_Standard loop
+ if Is_Generic_Subprogram (S) then
+ return;
+ end if;
+
+ S := Scope (S);
+ end loop;
+ end;
+
Elmt := First_Elmt (To_Clean);
while Present (Elmt) loop