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



             Bug #: 56156

           Summary: Reject INTERFACE blocks in procedures which import

                    local nonseq. TYPE decls

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Keywords: rejects-valid

          Severity: normal

          Priority: P3

         Component: fortran

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: bur...@gcc.gnu.org





Cf. https://groups.google.com/forum/#!topic/comp.lang.fortran/q63uc66POm4



The following code is invalid as one is not able to write a conforming

subroutine "S":



PROGRAM MAIN

 TYPE T

   INTEGER :: Y

 END TYPE T

 INTERFACE

   SUBROUTINE S(X)

     IMPORT :: T

     TYPE(T) :: X

   END SUBROUTINE S

 END INTERFACE





Hence, gfortran should reject procedures, declared in an INTERFACE block

(unless ABSTRACT), if they use a non-BIND(C), non-SEQUENCE TYPE which has been

declared in a procedure.



Using an abstract interface is fine as one can use it as procedure pointer:

  procedure(s), pointer :: p

  p => sub2  ! sub2 is an internal procedure



While sequence types, bind(c) types and types declared in the specification

part of a module are valid for obvious reasons.

Reply via email to