From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1235C3858D33; Mon, 25 Mar 2024 19:27:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1235C3858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1711394859; bh=Ogf1p+fJjZA88xQOfJZt8P9qFQ3dVfp7XD3SV2iy8Es=; h=From:To:Subject:Date:From; b=djoGogRtXuUN6Jvg4TQYIxsaK0vd5t+lkOnNROYJc/45++XRfEmdRp43qjnWCrdoT hBShTk76C5YzVr5xHVmS/AzkYjGFI5iF9QxA3B5sLNQMNncdqFwaqD4sEeGGjXqDPL FBw5TSHS9kuULJscRMab0sQo4LJLJyJxbRFJHAhA= From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/114474] New: [11/12/13/14 Regression] DATA statement with derived type, pointer component rejected Date: Mon, 25 Mar 2024 19:27:38 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: anlauf at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D114474 Bug ID: 114474 Summary: [11/12/13/14 Regression] DATA statement with derived type, pointer component rejected Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: anlauf at gcc dot gnu.org Target Milestone: --- While working on pr50410, I noticed that the following code works with gfortran <=3D 9.5.0, but fails with 10.5.0 and higher: program p implicit none integer, target :: zz =3D 42 ! initial data target type t integer, pointer :: h end type t type(t) :: x, y data x / t(null()) / ! OK data y / t(zz) / ! fails starting with gcc-10 if (associated (y% h)) print *, y% h end This works with NAG and older gfortran and prints "42". Current mainline gives: pr50410_ctor.f90:9:13: 9 | data y / t(zz) / ! fails starting with gcc-10 | 1 Error: The element in the structure constructor at (1), for pointer compone= nt 'h', is PROCEDURE but should be INTEGER=