[Bug fortran/85144] New: Wrong assignment with allocatable charlen

tkoenig at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Mar 31 16:28:00 GMT 2018


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

            Bug ID: 85144
           Summary: Wrong assignment with allocatable charlen
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tkoenig at gcc dot gnu.org
  Target Milestone: ---

From c.l.f.

The program

! Original test case by Manfred Tietze
program show_problem
    implicit none

! derived type with an array of strings with variable length
    type var_text
        character(len=:), dimension(:), allocatable :: text
    end type var_text

    type(var_text) :: b
    integer :: i

! test with an array of variable length strings
    allocate(character(len=3) :: b%text(3))
    b%text(1) = 'abc'
    b%text(2) = '123'
    print *,b%text(1)
    print *,"x",b%text,"x"

yields, with current trunk

 123
 xx


More information about the Gcc-bugs mailing list