public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mscfd at gmx dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/97612] New: Structure constructor of type with nested allocatable array components fails to compile
Date: Wed, 28 Oct 2020 08:51:33 +0000	[thread overview]
Message-ID: <bug-97612-4@http.gcc.gnu.org/bugzilla/> (raw)

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

             reply	other threads:[~2020-10-28  8:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-28  8:51 mscfd at gmx dot net [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-97612-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).