Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28445 Discussions

Extends Abstract Parameterized Derived Type

Blane_J_
New Contributor I
358 Views

Hi, the following code snippet can be compiled but the compiler showed a warning messge that I didn't quite understand.

module test1
    implicit none
    
    private
    public :: tp1
    
    type, abstract :: tp1(length)
        private
        integer, len      :: length = 10
        character(length) :: s
    contains
        procedure(isub1), public, pass, deferred :: sub1
    end type tp1
    
    abstract interface
        subroutine isub1(this)
            import tp1
            class(tp1(*)), intent(in) :: this
        end subroutine isub1
    end interface
    
end module test1
    
module test2
    use test1, only: tp1
    implicit none
    
    private
    public :: tp2
    
    type, abstract, extends(tp1) :: tp2
    end type tp2
    
end module test2

warning #7925: An interface-block in a subprogram that contains an interface-body for a procedure defined by that subprogram is non-standard.   [TEST1^ISUB1]

If tp1 is not a parameterized type, the inheritance is just OK. So is there any restriction for extending an abstract parameterized derived type ?

0 Kudos
2 Replies
FortranFan
Honored Contributor II
358 Views

Looks like a false warning, suggest you submit this case to Intel support (OSC).

0 Kudos
Blane_J_
New Contributor I
358 Views

Thanks FortranFan, I've reported it to the OSC.

0 Kudos
Reply