This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/50541] gfortran should not accept a pointer as a generic-name (r178939)
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 28 Sep 2011 11:14:16 +0000
- Subject: [Bug fortran/50541] gfortran should not accept a pointer as a generic-name (r178939)
- Auto-submitted: auto-generated
- References: <bug-50541-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50541
--- Comment #2 from janus at gcc dot gnu.org 2011-09-28 11:14:16 UTC ---
(In reply to comment #1)
> This one is trivial:
Unfortunately this causes one testsuite regression:
FAIL: gfortran.dg/func_derived_4.f90 -O0 (test for excess errors)
Reduced test case:
module class_field
implicit none
interface msh
module procedure msh
end interface
contains
function msh()
integer, pointer :: msh
end function
end module
What is special about this, is that the generic and the specific procedure
share the same name. I think the problem is that we only have one symbol for
both, which triggers the conflict.
Possible solutions:
* (quick'n'dirty) refine the check to only raise a conflict if there is no
specific procedure with the same name
* (cleaner but harder) introduce separate symbols for generics (in a separate
symtree), which might also solve our problems with 'constructors' (cf. PR
39427)
For specifics and generics with the same name, see also PR 42418.