[Patch, fortran] PR43291 - [4.5 regression] [OOP] Type mismatch in argument; passed CLASS(t1) to CLASS(t2)

Janus Weil janus@gcc.gnu.org
Thu Mar 11 21:27:00 GMT 2010


Hi Paul,

> Bootstrapped and regtested on RHEL5.2/x86_64 - OK for trunk?

yes, I think the patch is ok.

However, one small thing that I don't particularly like is your
renaming of the two functions. I'm already not quite happy with
'resolve_compcall' and 'resolve_typebound_call' for resolving
type-bound functions and subroutines, respectively. Just from those
names it's hard to remember which one does what. And now you introduce
'resolve_comp_call' and 'resolve_type_bound_call' in addition ... !

I guess I liked the old naming better. Still better would be something
like 'resolve_typebound_function', 'resolve_typebound_subroutine' etc.

Now you may say, it's just a name. But I think a proper descriptive
naming scheme is quite important in order to get an intuitive feeling
for what is happening in the code without having to look up every
single function. (But then again, it's also a matter of taste, and
this is just my subjective opinion. So, as I said: Ok to commit.)

Thanks for the patch!

Cheers,
Janus



> 2010-03-11  Paul Thomas  <pault@gcc.gnu.org>
>
>        PR fortran/43291
>        * resolve.c (resolve_compcall): Add new boolean dummy argument
>        'class_members'. Only resolve expression at end if false.
>        Remove redundant, static variable 'class_object'.
>        (check_class_members): Add extra argument to call of
>        resolve_compcall.
>        (resolve_comp_call): Renamed from resolve_class_compcall. Do
>        all the detection of class references here. Correct calls to
>        resolve_compcall for extra argument.
>        (resolve_type_bound_call): Was resolve_class_typebound_call.
>        Otherwise same as resolve_comp_call.
>        (gfc_resolve_expr): Call resolve_comp_call.
>        (resolve_code): Call resolve_type_bound_call.
>
> 2010-03-11  Paul Thomas  <pault@gcc.gnu.org>
>
>        PR fortran/43291
>        * gfortran.dg/dynamic_dispatch_7.f03: New test.
>



More information about the Gcc-patches mailing list