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

            Bug ID: 86472
           Summary: allocatable array,  bound-procedure, submodule
           Product: gcc
           Version: 8.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jfeng33 at hotmail dot com
  Target Milestone: ---

Module M1
    implicit none

    type :: mytype
        contains
        procedure :: myfunc1
    end type

    interface

    module subroutine myfunc1(self, a)
        class(mytype), intent(in) :: self
        real, intent(in) :: a(:)
        real, allocatable :: t(:)
    end subroutine myfunc1
    end interface
End Module M1
------------------------------------------
submodule(M1) M2
    contains

    module procedure myfunc1
!        real, allocatable :: t(:)
        allocate(t, source=a)
        x=10.0
        print *,t, a, x
    end procedure myfunc1
end submodule M2

=========================================

submodule M2 showed compilation error (Error: Allocate-object  is neither a
data pointer nor an allocatable variable) without re-declare variable t. Also
un-declared variable x gives no error.

Reply via email to