Hi all, here is a patch related to type-bound operators, which fixes both PR 49591 and parts of PR 41951 (namely comment #12). The central piece of the patch is the resolve.c part. This adds all type-bound operator routines also to the non-typebound operator list (i.e. ns->op). In this way, duplicates and ambiguities will be found also for cases where 1) operators are bound to different types or 2) one operator is bound to a type and one is not.
We have to be careful to do this only in the original namespace (where the type is defined), and not in namespaces where the type is use-associated (otherwise operators will be added twice). Also we can not do it for private operators and deferred ones (which is the reason for not throwing an error on PR 41951 comment #11 and friends). The patch was regtested on x86_64-unknown-linux-gnu. Ok for trunk? Cheers, Janus 2012-06-27 Janus Weil <ja...@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 <ja...@gcc.gnu.org> PR fortran/41951 PR fortran/49591 * gfortran.dg/typebound_operator_16.f03: New.
pr41951_49591.diff
Description: Binary data
typebound_operator_16.f03
Description: Binary data