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/52365] Procedure interface wrongly imported into interface without IMPORT


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.


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