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/56156] New: Reject INTERFACE blocks in procedures which import local nonseq. TYPE decls


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: unassigned@gcc.gnu.org
        ReportedBy: burnus@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.


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