From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A9120392DFDB; Fri, 7 Jun 2024 08:10:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A9120392DFDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1717747859; bh=uyqEZYqCigI7i7A4GCUghKFe0D0qvLxWJ6eBDRyePmI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=S3GkGOzwMq7N9yBQXWB7+re9yABUUEUFTU7VuPps6gpMKgXupO4/yGhtpxAaj56Yd tPSvYbT0uYL1mrHiPbeonzLyUOTorvlIz3HJuZ+q2ZrBdh2/THYn2xnyL//sH8JHVN YD2LRR9BR8tciIJQ0aRHNSJ3a36mxak5pN6WWwfU= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/90072] Polymorphic Dispatch to Polymophic Return Type Memory Leak Date: Fri, 07 Jun 2024 08:10:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 8.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: vehre at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D90072 --- Comment #3 from GCC Commits --- The master branch has been updated by Andre Vehreschild : https://gcc.gnu.org/g:51046e46ae66ca95bf2b93ae60f0c4d6b338f8af commit r15-1090-g51046e46ae66ca95bf2b93ae60f0c4d6b338f8af Author: Andre Vehreschild Date: Wed Jul 19 11:57:43 2023 +0200 Fix returned type to be allocatable for user-functions. The returned type of user-defined function returning a class object was not detected and handled correctly, which lead to memory leaks. PR fortran/90072 gcc/fortran/ChangeLog: * expr.cc (gfc_is_alloc_class_scalar_function): Detect allocatable class return types also for user-defined functions. * trans-expr.cc (gfc_conv_procedure_call): Same. (trans_class_vptr_len_assignment): Compute vptr len assignment correctly for user-defined functions. gcc/testsuite/ChangeLog: * gfortran.dg/class_77.f90: New test.=