This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, Fortran, OOP] PR 49591/41951 (Multiple identical specific procedures in type-bound operator not detected)


Hi Janus,

On 06/27/2012 02:42 PM, Janus Weil wrote:
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).

Can you add a note to the PR after committal?


Regarding the test case: Please also refer to "interpreation request F03/0018".

Sorry for being a bean counter, but in gfc_add_interface the lines are too long: Before 84 now 107 characters.

Otherwise, the patch looks OK. Thanks for going through the list of OOP bugs.

Tobias

The patch was regtested on x86_64-unknown-linux-gnu. Ok for trunk?

Cheers,
Janus


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]