aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-expr.c
diff options
context:
space:
mode:
authorMikael Morin <mikael@gcc.gnu.org>2012-03-04 21:50:08 +0000
committerMikael Morin <mikael@gcc.gnu.org>2012-03-04 21:50:08 +0000
commit5bf5fa563aea3f8763d2c49d53bf8a0d8c1bc7c2 (patch)
tree7065977b6c71f54588660cd5fd71f801483a0a0b /gcc/fortran/trans-expr.c
parentf0050a4b2a8ac6d61eeffcac8ad484be9ed462a3 (diff)
downloadgcc-5bf5fa563aea3f8763d2c49d53bf8a0d8c1bc7c2.zip
gcc-5bf5fa563aea3f8763d2c49d53bf8a0d8c1bc7c2.tar.gz
gcc-5bf5fa563aea3f8763d2c49d53bf8a0d8c1bc7c2.tar.bz2
re PR fortran/50981 ([OOP] Wrong-code for scalarizing ELEMENTAL call with absent OPTIONAL argument)
fortran/ PR fortran/50981 * gfortran.h (gfc_is_class_container_ref): New prototype. * class.c (gfc_is_class_container_ref): New function. * trans-expr.c (gfc_conv_procedure_call): Add a "_data" component reference to polymorphic actual arguments. testsuite/ PR fortran/50981 * gfortran.dg/elemental_optional_args_5.f03: Add subcomponent actual argument checks. From-SVN: r184904
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r--gcc/fortran/trans-expr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 83e3c9c..036b55b 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -3542,6 +3542,10 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
else
gfc_conv_expr_reference (&parmse, e);
+ if (fsym && fsym->ts.type == BT_DERIVED
+ && gfc_is_class_container_ref (e))
+ parmse.expr = gfc_class_data_get (parmse.expr);
+
/* If we are passing an absent array as optional dummy to an
elemental procedure, make sure that we pass NULL when the data
pointer is NULL. We need this extra conditional because of