[Bug fortran/60357] [F08] structure constructor with unspecified values for allocatable components

dominiq at lps dot ens.fr gcc-bugzilla@gcc.gnu.org
Tue Aug 12 15:15:00 GMT 2014


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

--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Note that while

    program testerprog
    use testmod
    Type(A) :: Me
    Me%y=2
    print *, Me%x, Me%y

    end program

gives at run time

           1           2

    program testerprog
    use testmod
    Type(A) :: Me
    allocate(Me%y)
    Me = A(X=1, y=2)
    print *, Me%y

    end program

gives

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.



More information about the Gcc-bugs mailing list