This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/51434] ICE with scalar init of an array parameter, used in DT default init with transfer
- From: "sgk at troutmask dot apl.washington.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 27 Feb 2018 15:32:33 +0000
- Subject: [Bug fortran/51434] ICE with scalar init of an array parameter, used in DT default init with transfer
- Auto-submitted: auto-generated
- References: <bug-51434-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51434
--- Comment #19 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Tue, Feb 27, 2018 at 01:54:11PM +0000, dominiq at lps dot ens.fr wrote:
>
> In addition, I don't understand why
>
> type t
> character :: z
> end type t
> type(t), parameter :: s(5) = t('a')
> type b
> character :: y(5) = transfer('abcde', s(1)%z)
> end type
> type(b) :: zz
> print *, zz
> print *, s(1)%z
> end
>
> prints
>
> aaaaa
> a
>
> Should not it be
>
> abcde
> a
>
No.
Case (i): If MOLD is a scalar and SIZE is absent, the result is a scalar.
print *. s(1)%z, rank(s(1)%z) gives
a 0