This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/37445] Host-associated proc not found if same-name generic is use-associated
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Sep 2008 18:44:54 -0000
- Subject: [Bug fortran/37445] Host-associated proc not found if same-name generic is use-associated
- References: <bug-37445-15125@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from burnus at gcc dot gnu dot org 2008-09-09 18:44 -------
Paul, sounds like a bug for you.
* * *
The problem is that gfortran calls the use-associated (generic or specific)
procedure instead of the host-associated procedure. (The procedure is
use-associated in the specification part of a module).
If the procedure is USEd in the subroutine or in a PROGRAM, all compilers print
an error.
* * *
I wonder whether the following is valid:
module m2
use, only: s1
All compilers accept this. However, how to read then the following, assuming
that s1 is also a host-associated procedure:
MODULE M2
USE M1, only: s1
procedure(),pointer :: procptr => s1
(Note: "procptr => s1" is Fortran 2008 syntax; F2003 only allows "=> null()".)
Actually, I would reject a program if "only:" is specified [or for "use m2,
s1=>s2"], but I have not checked the standard, yet.
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu dot
| |org
Summary|incorrect error reported |Host-associated proc not
| |found if same-name generic
| |is use-associated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37445