aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r--gcc/fortran/expr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 188e796..4f456fc 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -6243,6 +6243,9 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
/* Variable not assignable from a PURE procedure but appears in
variable definition context. */
+ own_scope = own_scope
+ || (sym->attr.result && sym->ns->proc_name
+ && sym == sym->ns->proc_name->result);
if (!pointer && !own_scope && gfc_pure (NULL) && gfc_impure_variable (sym))
{
if (context)