diff options
author | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-20 04:16:02 +0000 |
---|---|---|
committer | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-20 04:16:02 +0000 |
commit | 191c342b44c76bde838b8a78c4aec45b82f85a5e (patch) | |
tree | 54f74b7bdddd62bec88cb3e0ebe881ed8385e3cd /gcc/fortran | |
parent | bcd06eff2aaf893c1a86d281ae1a7b441a401967 (diff) | |
download | gcc-191c342b44c76bde838b8a78c4aec45b82f85a5e.tar.gz |
2009-10-20 Paul Thomas <pault@gcc.gnu.org>
PR fortran/41706
* resolve.c (resolve_arg_exprs): New function.
(resolve_class_compcall): Call the above.
(resolve_class_typebound_call): The same.
2009-10-20 Paul Thomas <pault@gcc.gnu.org>
PR fortran/41706
* gfortran.dg/class_9 : New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153004 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/resolve.c | 24 |
2 files changed, 30 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index ce18d2d46b6..0528e593108 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2009-10-20 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/41706 + * resolve.c (resolve_arg_exprs): New function. + (resolve_class_compcall): Call the above. + (resolve_class_typebound_call): The same. + 2009-10-19 Janus Weil <janus@gcc.gnu.org> PR fortran/41586 diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 285228c4405..42b6e76fc3a 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -5275,6 +5275,22 @@ get_declared_from_expr (gfc_ref **class_ref, gfc_ref **new_ref, } +/* Resolve the argument expressions so that any arguments expressions + that include class methods are resolved before the current call. + This is necessary because of the static variables used in CLASS + method resolution. */ +static void +resolve_arg_exprs (gfc_actual_arglist *arg) +{ + /* Resolve the actual arglist expressions. */ + for (; arg; arg = arg->next) + { + if (arg->expr) + gfc_resolve_expr (arg->expr); + } +} + + /* Resolve a CLASS typebound function, or 'method'. */ static gfc_try resolve_class_compcall (gfc_expr* e) @@ -5295,7 +5311,10 @@ resolve_class_compcall (gfc_expr* e) { gfc_free_ref_list (new_ref); return resolve_compcall (e, true); - } + } + + /* Resolve the argument expressions, */ + resolve_arg_exprs (e->value.function.actual); /* Get the data component, which is of the declared type. */ derived = declared->components->ts.u.derived; @@ -5349,6 +5368,9 @@ resolve_class_typebound_call (gfc_code *code) return resolve_typebound_call (code); } + /* Resolve the argument expressions, */ + resolve_arg_exprs (code->ext.actual); + /* Get the data component, which is of the declared type. */ derived = declared->components->ts.u.derived; |