aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-expr.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2016-10-21 12:50:56 +0000
committerPaul Thomas <pault@gcc.gnu.org>2016-10-21 12:50:56 +0000
commitde514d407ef8af0b0ba377d8934348702cf87d05 (patch)
tree8c272f3218f0e29691939ff45b3f7f5bd4e1a7af /gcc/fortran/trans-expr.c
parentdfe08bc4ef2810b98e0ce8ffca4155ad304e0429 (diff)
downloadgcc-de514d407ef8af0b0ba377d8934348702cf87d05.zip
gcc-de514d407ef8af0b0ba377d8934348702cf87d05.tar.gz
gcc-de514d407ef8af0b0ba377d8934348702cf87d05.tar.bz2
re PR fortran/69566 ([OOP] Failure of SELECT TYPE with unlimited polymorphic function result)
2016-10-21 Paul Thomas <pault@gcc.gnu.org> PR fortran/69566 * resolve.c (fixup_array_ref): New function. (resolve_select_type): Gather up the rank and array reference, if any, from the selector. Fix up the 'associate name' and the 'associate entities' as necessary. * trans-expr.c (gfc_conv_class_to_class): If the symbol backend decl is a FUNCTION_DECL, use the 'fake_result_decl' instead. 2016-10-21 Paul Thomas <pault@gcc.gnu.org> PR fortran/69566 * gfortran.dg/select_type_37.f03: New test. From-SVN: r241403
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r--gcc/fortran/trans-expr.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 6b974db..2f8ea22 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -1033,8 +1033,13 @@ gfc_conv_class_to_class (gfc_se *parmse, gfc_expr *e, gfc_typespec class_ts,
&& e->symtree && e->symtree->n.sym->ts.type == BT_CLASS)
{
tmp = e->symtree->n.sym->backend_decl;
+
+ if (TREE_CODE (tmp) == FUNCTION_DECL)
+ tmp = gfc_get_fake_result_decl (e->symtree->n.sym, 0);
+
if (DECL_LANG_SPECIFIC (tmp) && GFC_DECL_SAVED_DESCRIPTOR (tmp))
tmp = GFC_DECL_SAVED_DESCRIPTOR (tmp);
+
slen = integer_zero_node;
}
else