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: Problem with contained procedures as of 110063


Andrew and Toon,

<>This looks like PR 25901.

I think this was caused by one of Paul T.'s patches.

'twas indeed. As I suspected, using patch in the field would shake out those combinations that I had missed. The following one line patch fixes the problem.

Index: gcc/fortran/decl.c
===================================================================
*** gcc/fortran/decl.c  (revision 110063)
--- gcc/fortran/decl.c  (working copy)
*************** get_proc_name (const char *name, gfc_sym
*** 614,619 ****
--- 614,620 ----
       /* Trap another encompassed procedure with the same name.  */
       if (sym->attr.flavor != 0
           && sym->attr.proc != 0
+           && sym->formal
           && (sym->attr.subroutine || sym->attr.function))
       gfc_error_now ("Procedure '%s' at %C is already defined at %L",
                      name, &sym->declared_at);

I do not want to commit it just yet because this new condition is probably sufficient by itself. I do not know why I did not think of it in the first place; the effort to find the "already declared" condition using the attributes was getting seriously tortured.

Please bear with me. I have to do family stuff now but will get back onto it tonight.

Paul


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