This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/51434] ICE with scalar init of an array parameter, used in DT default init with transfer


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]