public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/97612] New: Structure constructor of type with nested allocatable array components fails to compile
@ 2020-10-28  8:51 mscfd at gmx dot net
  2020-12-02 20:15 ` [Bug fortran/97612] " dominiq at lps dot ens.fr
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: mscfd at gmx dot net @ 2020-10-28  8:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97612
           Summary: Structure constructor of type with nested allocatable
                    array components fails to compile
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mscfd at gmx dot net
  Target Milestone: ---

The program below does not compile with error message:

constructor_allocatable.F90:4:9:

    4 | type :: s
      |         1
Error: The rank of the element in the structure constructor at (1) does not
match that of the component (0/1)

It is essential that x is an array, and that component u of type s has the
allocatable attribute as well. However, component u does not need to be an
array to trigger the error.


program constructor_allocatable
implicit none

type :: s
   integer, dimension(:), allocatable :: u
end type s

type :: t
   type(s), dimension(:), allocatable :: x
end type t

type(t) :: a = t()

end program constructor_allocatable

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

end of thread, other threads:[~2021-09-10 20:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-28  8:51 [Bug fortran/97612] New: Structure constructor of type with nested allocatable array components fails to compile mscfd at gmx dot net
2020-12-02 20:15 ` [Bug fortran/97612] " dominiq at lps dot ens.fr
2020-12-07  9:23 ` mscfd at gmx dot net
2020-12-07 12:46 ` [Bug fortran/97612] [F08] " dominiq at lps dot ens.fr
2020-12-18 12:20 ` pault at gcc dot gnu.org
2020-12-29 17:50 ` cvs-commit at gcc dot gnu.org
2021-05-04 12:31 ` rguenth at gcc dot gnu.org
2021-09-10 20:49 ` cvs-commit at gcc dot gnu.org
2021-09-10 20:50 ` cvs-commit at gcc dot gnu.org
2021-09-10 20:52 ` 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).