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

--- Comment #2 from Zaak <zbeekman at gmail dot com> ---
Try this:

program test3
  INTEGER,PARAMETER :: ucs4 = selected_char_kind("ISO_10646")
  CHARACTER(3,UCS4),PARAMETER ::
unip=CHAR(INT(Z'5e74'),UCS4)//CHAR(INT(Z'6708'),ucs4)//CHAR(INT(Z'65e5'),ucs4)
  character(3,UCS4) :: uni
  uni = unip
  open(6, encoding="utf-8")
  print *, uni
  print *, uni(2:2)
  print *, unip
  print *, "'",unip(1:1),"'"
  call write_it(unip(2:2))
contains
    subroutine write_it(str)
        character(len=*,kind=UCS4) ,intent(in) :: str
        print *, str
    end subroutine write_it
end program test3


I get this error message when I try to compile:

$ gfortran test3.f90
test3.f90:11.16:

  call write_it(unip(2:2))
                1
Error: Type mismatch in argument 'str' at (1); passed CHARACTER(1) to
CHARACTER(4)

Reply via email to