public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/114474] New: [11/12/13/14 Regression] DATA statement with derived type, pointer component rejected
@ 2024-03-25 19:27 anlauf at gcc dot gnu.org
  2024-03-25 19:28 ` [Bug fortran/114474] " anlauf at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: anlauf at gcc dot gnu.org @ 2024-03-25 19:27 UTC (permalink / raw)
  To: gcc-bugs

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

            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 <= 9.5.0, but fails with 10.5.0 and higher:

program p
  implicit none
  integer, target     :: zz = 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 component
'h', is PROCEDURE but should be INTEGER

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-04-07 18:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-25 19:27 [Bug fortran/114474] New: [11/12/13/14 Regression] DATA statement with derived type, pointer component rejected anlauf at gcc dot gnu.org
2024-03-25 19:28 ` [Bug fortran/114474] " anlauf at gcc dot gnu.org
2024-03-25 20:55 ` anlauf at gcc dot gnu.org
2024-03-26 21:29 ` anlauf at gcc dot gnu.org
2024-03-27 20:43 ` anlauf at gcc dot gnu.org
2024-03-28 17:44 ` cvs-commit at gcc dot gnu.org
2024-04-07 18:10 ` cvs-commit at gcc dot gnu.org
2024-04-07 18:12 ` cvs-commit at gcc dot gnu.org
2024-04-07 18:13 ` cvs-commit at gcc dot gnu.org
2024-04-07 18:14 ` anlauf at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).