http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55297
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |janus at gcc dot gnu.org
|gnu.org |
--- Comment #3 from janus at gcc dot gnu.org 2012-11-16 11:41:50 UTC ---
(In reply to comment #2)
> The question is whether it should be fixed by adding
> if (derived->ns != gfc_current_ns)
> return;
Yes, something along this line seems like the appropriate fix to me. In
particular I would propose the following (which does fix the test case):
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c (revision 193552)
+++ gcc/fortran/resolve.c (working copy)
@@ -11540,7 +11540,7 @@ resolve_typebound_intrinsic_op (gfc_symbol* derive
/* Add target to non-typebound operator list. */
if (!target->specific->deferred && !derived->attr.use_assoc
- && p->access != ACCESS_PRIVATE)
+ && p->access != ACCESS_PRIVATE && derived->ns == gfc_current_ns)
{
gfc_interface *head, *intr;
if (gfc_check_new_interface (derived->ns->op[op], target_proc,
Will commit as obvious after regtesting ...