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

--- Comment #11 from anlauf at gcc dot gnu.org ---
(In reply to Christopher Albert from comment #10)
> Created attachment 62808 [details]
> Add type conversions in arith.cc
> 
> This should fix it. Is it what you intended?

In principle yes.

For numeric types it seems to work nicely.  :-)

For constant character constructors, we still fail in various ways:

  print *, [ character(16) :: ['a','b']  ] // "|"
  print *, [[character(16) :: ['a','b'] ]] // "|"
end

Compiling with -fdump-fortran-original I get:

pr107721.f90:2:35:

    2 |   print *, [[character(16) :: ['a','b'] ]] // "|"
      |                                   1
Warning: Legacy Extension: The CHARACTER elements of the array constructor at
(1) must have the same length (16/1)
pr107721.f90:2:35:

    2 |   print *, [[character(16) :: ['a','b'] ]] // "|"
      |                                   1
Error: Different CHARACTER lengths (17/2) in array constructor at (1)

Namespace: A-H: (REAL 4) I-N: (INTEGER 4) O-Z: (REAL 4)
procedure name = MAIN__
  symtree: 'MAIN__'      || symbol: 'MAIN__'       
    type spec : (UNKNOWN 0)
    attributes: (PROGRAM PUBLIC  SUBROUTINE IS-MAIN-PROGRAM)

  code:
  WRITE UNIT=6 FMT=-1
  TRANSFER (/ 'a               |' , 'b               |' /)
  DT_END
  WRITE UNIT=6 FMT=-1
  TRANSFER (/ 'a               |' , 'b|' /)
  DT_END

------------------------------------------

Reply via email to