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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 9595466..76ceec9 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -2305,6 +2305,12 @@ check_inquiry (gfc_expr *e, int not_restricted)
&& ap->expr->expr_type != EXPR_VARIABLE
&& check_restricted (ap->expr) == FAILURE)
return MATCH_ERROR;
+
+ if (not_restricted == 0
+ && ap->expr->expr_type == EXPR_VARIABLE
+ && ap->expr->symtree->n.sym->attr.dummy
+ && ap->expr->symtree->n.sym->attr.optional)
+ return MATCH_NO;
}
return MATCH_YES;