This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/56156] New: Reject INTERFACE blocks in procedures which import local nonseq. TYPE decls
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 30 Jan 2013 16:33:12 +0000
- Subject: [Bug fortran/56156] New: Reject INTERFACE blocks in procedures which import local nonseq. TYPE decls
- Auto-submitted: auto-generated
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.