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/50541] gfortran should not accept a pointer as a generic-name (r178939)


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.


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