This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/86472] allocatable array, bound-procedure, submodule


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

--- Comment #6 from Jim Feng <jfeng33 at hotmail dot com> ---
't' is a local variable of myfunc1. If I change to following:
------------------------------------------------------------
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(:)
    end subroutine myfunc1
    end interface
End Module M1


submodule(M1) M2
    contains

    module procedure myfunc1
        implicit none
        real, allocatable :: t(:)
        real :: x

        allocate(t, source=a)
        x=10.0
        print *,t, a, x
    end procedure myfunc1
end submodule M2
------------------------------------------------
Everything goes through without error. I thought "Such specifications have no
effect." was not clear. The uncharacteristic entities should not be specified
in the interface.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]