From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14068 invoked by alias); 18 Dec 2012 03:15:52 -0000 Received: (qmail 13993 invoked by uid 48); 18 Dec 2012 03:15:29 -0000 From: "demoonlit at panathenaia dot halfmoon.jp" To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/55725] New: Anonymous access returned from library-level function is finalized too early, RM 3.10.2(10/2 or 10.3/3) Date: Tue, 18 Dec 2012 03:15:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ada X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: demoonlit at panathenaia dot halfmoon.jp X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-12/txt/msg01702.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55725 Bug #: 55725 Summary: Anonymous access returned from library-level function is finalized too early, RM 3.10.2(10/2 or 10.3/3) Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada AssignedTo: unassigned@gcc.gnu.org ReportedBy: demoonlit@panathenaia.halfmoon.jp Created attachment 28989 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28989 minimal bug triggering source code An allocated object via anonymous access type returned from a library-level function like F may be finalized inside of the function. with Something; function F return access T; function F return access T is begin return new T; -- It returns new allocated value -- The allocated object may be finalized here end F; If a function is declared in a package, it behaves right. This bug has also been discussed on comp.lang.ada.