aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2012-06-27 19:38:00 +0200
committerJanus Weil <janus@gcc.gnu.org>2012-06-27 19:38:00 +0200
commit362aa474604751c48e9ff6c39fcf81ee9adad8d2 (patch)
treee4e01843836bcc2058fb6dd585f2390353bb6a21 /gcc/fortran/resolve.c
parentb585a51fb9b8c310ec7877bd7f0a93626b1d822a (diff)
downloadgcc-362aa474604751c48e9ff6c39fcf81ee9adad8d2.zip
gcc-362aa474604751c48e9ff6c39fcf81ee9adad8d2.tar.gz
gcc-362aa474604751c48e9ff6c39fcf81ee9adad8d2.tar.bz2
re PR fortran/41951 ([OOP] Not diagnosing ambiguous operators (TB vs. INTERFACE))
2012-06-27 Janus Weil <janus@gcc.gnu.org> PR fortran/41951 PR fortran/49591 * interface.c (check_new_interface): Rename, add 'loc' argument, make non-static. (gfc_add_interface): Rename 'check_new_interface' * gfortran.h (gfc_check_new_interface): Add prototype. * resolve.c (resolve_typebound_intrinsic_op): Add typebound operator targets to non-typebound operator list. 2012-06-27 Janus Weil <janus@gcc.gnu.org> PR fortran/41951 PR fortran/49591 * gfortran.dg/typebound_operator_16.f03: New. From-SVN: r189022
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 4595f76..0434e08 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -11264,6 +11264,22 @@ resolve_typebound_intrinsic_op (gfc_symbol* derived, gfc_intrinsic_op op,
if (!gfc_check_operator_interface (target_proc, op, p->where))
goto error;
+
+ /* Add target to non-typebound operator list. */
+ if (!target->specific->deferred && !derived->attr.use_assoc
+ && p->access != ACCESS_PRIVATE)
+ {
+ gfc_interface *head, *intr;
+ if (gfc_check_new_interface (derived->ns->op[op], target_proc,
+ p->where) == FAILURE)
+ return FAILURE;
+ head = derived->ns->op[op];
+ intr = gfc_get_interface ();
+ intr->sym = target_proc;
+ intr->where = p->where;
+ intr->next = head;
+ derived->ns->op[op] = intr;
+ }
}
return SUCCESS;