This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/52365] Procedure interface wrongly imported into interface without IMPORT
- 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: Fri, 24 Feb 2012 11:16:09 +0000
- Subject: [Bug fortran/52365] Procedure interface wrongly imported into interface without IMPORT
- Auto-submitted: auto-generated
- References: <bug-52365-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52365
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-02-24 11:16:09 UTC ---
Note: I think the following variant is valid, where the symbol is in the same
interface block. (Correctly accepted.)
interface
subroutine foo()
end subroutine foo
subroutine bar(x)
procedure(foo) :: x
end subroutine bar
end interface
end
While the following variant is also invalid (but accepted):
module m
interface
subroutine bar(x)
procedure(foo) :: x
end subroutine bar
end interface
contains
subroutine foo()
end subroutine foo
end
Hence, a simple check in decl.c is not possible as it will come too early for
the second example. Still, some check should probably added to decl.c's
match_procedure_interface - similarly to the
gfc_current_ns->proc_name->attr.if_source == IFSRC_IFBODY
check in variable_decl.
Another check should be done at resolve_procedure_interface - or possibly the
only check, if one modifies the way where the decl is declared for
IFSRC_IFBODY.