This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: Module generic function problem


Hi all,

This patch fixes the problem I gave in my earlier e-mail, but I'm not sure if its a good way to fix it or not. I'm checking whether it breaks anything else, but the problem is definately with the function namespace not including the module which it is part of.

Made check and it seems to give the same answer as before.

It could be due to the IMPLICIT statement excluding the parent namespace, or marking it as private... Its very confusing ;-)

Comments on better ways to fix this are welcome!

Matt

Index: primary.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/fortran/primary.c,v
retrieving revision 1.13
diff -d -c -r1.13 primary.c
*** primary.c   7 Oct 2004 15:12:01 -0000       1.13
--- primary.c   14 Oct 2004 12:59:32 -0000
***************
*** 2134,2140 ****
        break;
  
      generic_function:
!       gfc_get_sym_tree (name, NULL, &symtree);        /* Can't fail */
  
        e = gfc_get_expr ();
        e->symtree = symtree;
--- 2134,2147 ----
        break;
  
      generic_function:
!       //gfc_get_sym_tree (name, NULL, &symtree);      /* Can't fail */
!       /* MLA 2004/10/14 - look at the parent namespace if the 
!        * current namespace is a module? */
!       gfc_get_sym_tree (name, 
!                       ((gfc_current_ns->proc_name != NULL) &&
!                        (gfc_current_ns->proc_name->attr.proc == PROC_MODULE)) 
!                       ? gfc_current_ns->parent : NULL, 
!                       &symtree);      /* Can't fail */
  
        e = gfc_get_expr ();
        e->symtree = symtree;

----- End forwarded message -----


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