aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2016-10-26 14:48:02 +0000
committerPaul Thomas <pault@gcc.gnu.org>2016-10-26 14:48:02 +0000
commitcd612e8a0124c51cd7bc3d18a1cba6c2d4e144c4 (patch)
tree5e5e9659a8da5c68bbeb2621896a64a1aa0f6446 /gcc/fortran/resolve.c
parentb4e7e6bf229664045926633aae90a287e39f6454 (diff)
downloadgcc-cd612e8a0124c51cd7bc3d18a1cba6c2d4e144c4.zip
gcc-cd612e8a0124c51cd7bc3d18a1cba6c2d4e144c4.tar.gz
gcc-cd612e8a0124c51cd7bc3d18a1cba6c2d4e144c4.tar.bz2
re PR fortran/78108 (Generic type-bound operator conflicts)
2016-10-26 Paul Thomas <pault@gcc.gnu.org> PR fortran/78108 * resolve.c (resolve_typebound_intrinsic_op): For submodules suppress the error and return if the same procedure symbol is added more than once to the interface. 2016-10-26 Paul Thomas <pault@gcc.gnu.org> PR fortran/78108 * gfortran.dg/submodule_18.f08: New test. * gfortran.dg/submodule_19.f08: New test. From-SVN: r241555
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 785203b..fe966aa 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -12797,7 +12797,17 @@ resolve_typebound_intrinsic_op (gfc_symbol* derived, gfc_intrinsic_op op,
&& p->access != ACCESS_PRIVATE && derived->ns == gfc_current_ns)
{
gfc_interface *head, *intr;
- if (!gfc_check_new_interface (derived->ns->op[op], target_proc, p->where))
+
+ /* Preempt 'gfc_check_new_interface' for submodules, where the
+ mechanism for handling module procedures winds up resolving
+ operator interfaces twice and would otherwise cause an error. */
+ for (intr = derived->ns->op[op]; intr; intr = intr->next)
+ if (intr->sym == target_proc
+ && target_proc->attr.used_in_submodule)
+ return true;
+
+ if (!gfc_check_new_interface (derived->ns->op[op],
+ target_proc, p->where))
return false;
head = derived->ns->op[op];
intr = gfc_get_interface ();