https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83002

            Bug ID: 83002
           Summary: Missing finalization of generic package body
           Product: gcc
           Version: 7.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: demoonlit at panathenaia dot halfmoon.jp
  Target Milestone: ---

Created attachment 42613
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42613&action=edit
bug triggering source code

Hello.

The finalizer of package body (postfixed "__finalize_body") for controlled
object is not generated when it is generic package (and its spec does not need
finalizer ?).

See the attached file and run. I've expected for getting "OK" outputted by the
finalizer, but did not. And it works correctly if the controlled object
declaration is moved to its spec.

This bug also appeared with GNAT-GPL 2017.

--------
with x;
generic
package y is
   pragma elaborate_body;
end y;

package body y is
   object : x.t; -- this controlled object would not be finalized
end y;

Reply via email to