https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122290
--- Comment #17 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
I just completed a pull of Paul's push on our test machine. I noticed the case
in comment #11 was still not fixed. Upon closer examination I could see
resolve.cc was not quite right. The following I applied manually and now the
pr.f90 example now compiles on the test machine.
diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc
index 0d5444848f0..c2c074fbbba 100644
--- a/gcc/fortran/resolve.cc
+++ b/gcc/fortran/resolve.cc
@@ -16083,6 +16083,7 @@ resolve_typebound_intrinsic_op (gfc_symbol* derived,
gfc_intrinsic_op op,
for (intr = derived->ns->op[op]; intr; intr = intr->next)
if (intr->sym == target_proc
&& (target_proc->attr.used_in_submodule
+ || derived->attr.pdt_template
|| derived->attr.pdt_type))
return true;