https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107721
--- Comment #16 from Christopher Albert <albert at tugraz dot at> ---
(In reply to anlauf from comment #14)
> (In reply to Christopher Albert from comment #13)
> > Created attachment 62813 [details]
> > Add type conversions in arith.cc
>
> > Thanks Harald, you always manage to immediately break things :) . character
> > constructors are a bit more involved, and the new patch passes tests again.
> > It also includes the suggested class(*) check now.
>
> This is a nice improvement!
>
> But since you asked me to break it once more, here you go:
> just add parentheses for an additional level of confusion...
>
> print *, [ character(16) :: 'a' // 'c', 'b' // 'de' ] ! OK
> print *, [ character(16) :: 'a' // 'c', ('b' // 'de') ] ! OK
> print *, [ character(16) :: ('a' // 'c'), 'b' // 'de' ] ! OK
> print *, [ character(16) :: 'a' // 'c', 'b' // 'de' ] // "|" ! OK
> print *, [ character(16) :: 'a' // 'c', ('b' // 'de') ] // "|" ! fail
> print *, [ character(16) :: ('a' // 'c'), 'b' // 'de' ] // "|" ! fail
>
> This gives:
>
> pr107721.f90:5:42:
>
> 5 | print *, [ character(16) :: 'a' // 'c', ('b' // 'de') ] // "|" !
> fail
> | 1
> Error: Different CHARACTER lengths (17/4) in array constructor at (1)
> pr107721.f90:6:43:
>
> 6 | print *, [ character(16) :: ('a' // 'c'), 'b' // 'de' ] // "|" !
> fail
> | 1
> Error: Different CHARACTER lengths (3/17) in array constructor at (1)
>
>
> For details try -fdump-fortran-original to get:
>
> code:
> WRITE UNIT=6 FMT=-1
> TRANSFER (/ 'ac ' , 'bde ' /)
> DT_END
> WRITE UNIT=6 FMT=-1
> TRANSFER (/ 'ac ' , 'bde ' /)
> DT_END
> WRITE UNIT=6 FMT=-1
> TRANSFER (/ 'ac ' , 'bde ' /)
> DT_END
> WRITE UNIT=6 FMT=-1
> TRANSFER (/ 'ac |' , 'bde |' /)
> DT_END
> WRITE UNIT=6 FMT=-1
> TRANSFER (/ 'ac |' , 'bde|' /)
> DT_END
> WRITE UNIT=6 FMT=-1
> TRANSFER (/ 'ac|' , 'bde |' /)
> DT_END
>
>
> (A minor side remark: git finds a few cases where you indent with spaces,
> but where tab should be used for 8 spaces. Might be an editor configuration
> issue.)
Thanks again! Please check the new patch.