diff options
author | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-05 18:19:55 +0000 |
---|---|---|
committer | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-05 18:19:55 +0000 |
commit | d94c13853accd0d733620f127edb7eb40e4b70b5 (patch) | |
tree | dcef12f6299ca2279a3958f860cb3333621196ed /gcc/fortran/symbol.c | |
parent | d574e46d09eb768248f82976b4ec853a2e1ef742 (diff) | |
download | gcc-d94c13853accd0d733620f127edb7eb40e4b70b5.tar.gz |
2009-10-05 Paul Thomas <pault@gcc.gnu.org>
* trans-expr.c (select_class_proc): New function.
(conv_function_val): Deal with class methods and call above.
* symbol.c (gfc_type_compatible): Treat case where both ts1 and
ts2 are BT_CLASS.
gfortran.h : Add structure gfc_class_esym_list and include in
the structure gfc_expr.
* module.c (load_derived_extensions): New function.
(read_module): Call above.
(write_dt_extensions): New function.
(write_derived_extensions): New function.
(write_module): Use the above.
* resolve.c (resolve_typebound_call): Add a function expression
for class methods. This carries the chain of symbols for the
dynamic dispatch in select_class_proc.
(resolve_compcall): Add second, boolean argument to indicate if
a function is being handled.
(check_members): New function.
(check_class_members): New function.
(resolve_class_compcall): New function.
(resolve_class_typebound_call): New function.
(gfc_resolve_expr): Call above for component calls..
2009-10-05 Paul Thomas <pault@gcc.gnu.org>
* gfortran.dg/dynamic_dispatch_1.f90: New test.
* gfortran.dg/dynamic_dispatch_2.f90: New test.
* gfortran.dg/dynamic_dispatch_3.f90: New test.
* gfortran.dg/module_md5_1.f90: Update md5 sum.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152463 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/symbol.c')
-rw-r--r-- | gcc/fortran/symbol.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 39285b16fea..8cd18db0a8f 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -4579,9 +4579,12 @@ gfc_type_compatible (gfc_typespec *ts1, gfc_typespec *ts2) if ((ts1->type == BT_DERIVED || ts1->type == BT_CLASS) && (ts2->type == BT_DERIVED || ts2->type == BT_CLASS)) { - if (ts1->type == BT_CLASS) + if (ts1->type == BT_CLASS && ts2->type == BT_DERIVED) return gfc_type_is_extension_of (ts1->u.derived->components->ts.u.derived, ts2->u.derived); + else if (ts1->type == BT_CLASS && ts2->type == BT_CLASS) + return gfc_type_is_extension_of (ts1->u.derived->components->ts.u.derived, + ts2->u.derived->components->ts.u.derived); else if (ts2->type != BT_CLASS) return gfc_compare_derived_types (ts1->u.derived, ts2->u.derived); else |