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

            Bug ID: 60357
           Summary: structure constructor with unspecified values for
                    allocatable components
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: antony at cosmologist dot info

This valid F2008 code is rejected:


    module testmod
    Type A
        integer :: X = 1
        integer, allocatable :: y 
    end type A
    end module

    program testerprog
    use testmod
    Type(A) :: Me = A(X=1)

    end program


Compiler error is:

Type(A) :: Me = A(X=1)
               1
Error: No initializer for component 'y' given in the structure constructor at
(1)!

However initialization statements are not required for allocatable components.

Reply via email to