summaryrefslogtreecommitdiffstats
path: root/gcc/fortran/primary.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/primary.c')
-rw-r--r--gcc/fortran/primary.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c
index e0021c54b18..0a917f7f048 100644
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -1938,7 +1938,7 @@ gfc_variable_attr (gfc_expr *expr, gfc_typespec *ts)
symbol_attribute attr;
gfc_ref *ref;
- if (expr->expr_type != EXPR_VARIABLE)
+ if (expr->expr_type != EXPR_VARIABLE && expr->expr_type != EXPR_FUNCTION)
gfc_internal_error ("gfc_variable_attr(): Expression isn't a variable");
ref = expr->ref;
@@ -2032,6 +2032,8 @@ gfc_expr_attr (gfc_expr *e)
if (e->value.function.esym != NULL)
attr = e->value.function.esym->result->attr;
+ else
+ attr = gfc_variable_attr (e, NULL);
/* TODO: NULL() returns pointers. May have to take care of this
here. */
OpenPOWER on IntegriCloud