diff options
author | Tobias Burnus <burnus@net-b.de> | 2012-07-19 22:20:17 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2012-07-19 22:20:17 +0200 |
commit | 3d333a280ffcb968aa3f561154fde4460ff5e429 (patch) | |
tree | 184c424f1429e8cc9e55ae799bd1b5431551e537 /gcc/fortran/trans-expr.c | |
parent | a73b8b59fb0c47fdf8a31f812867ec56744ec6a4 (diff) | |
download | gcc-3d333a280ffcb968aa3f561154fde4460ff5e429.zip gcc-3d333a280ffcb968aa3f561154fde4460ff5e429.tar.gz gcc-3d333a280ffcb968aa3f561154fde4460ff5e429.tar.bz2 |
trans-expr.c (gfc_conv_procedure_call): Fix handling of polymorphic arguments.
2012-07-19 Tobias Burnus <burnus@net-b.de>
* trans-expr.c (gfc_conv_procedure_call): Fix handling
of polymorphic arguments.
* resolve.c (resolve_formal_arglist): Ditto, mark polymorphic
assumed-shape arrays as such.
From-SVN: r189678
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r-- | gcc/fortran/trans-expr.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 34e0f69..17964bb 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -3620,10 +3620,15 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, parmse.string_length = build_int_cst (gfc_charlen_type_node, 0); } } - else if (arg->expr->expr_type == EXPR_NULL && fsym && !fsym->attr.pointer) + else if (arg->expr->expr_type == EXPR_NULL + && fsym && !fsym->attr.pointer + && (fsym->ts.type != BT_CLASS + || !CLASS_DATA (fsym)->attr.class_pointer)) { /* Pass a NULL pointer to denote an absent arg. */ - gcc_assert (fsym->attr.optional && !fsym->attr.allocatable); + gcc_assert (fsym->attr.optional && !fsym->attr.allocatable + && (fsym->ts.type != BT_CLASS + || !CLASS_DATA (fsym)->attr.allocatable)); gfc_init_se (&parmse, NULL); parmse.expr = null_pointer_node; if (arg->missing_arg_type == BT_CHARACTER) |