diff options
author | Steven G. Kargl <kargl@gcc.gnu.org> | 2010-09-09 18:52:11 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2010-09-09 18:52:11 +0000 |
commit | 26865ab4e8a09b607fae1c338137a4ac65c476cc (patch) | |
tree | a432bf98d9ee2e60655380588d94eed4e8d7d7f5 /gcc/fortran/expr.c | |
parent | b1012ca4be23e00404c49f8520196af908110a10 (diff) | |
download | gcc-26865ab4e8a09b607fae1c338137a4ac65c476cc.zip gcc-26865ab4e8a09b607fae1c338137a4ac65c476cc.tar.gz gcc-26865ab4e8a09b607fae1c338137a4ac65c476cc.tar.bz2 |
dummy_optional_arg.f90: New test.
2010-09-09 Steven G. Kargl <kargl@gcc.gnu.org>
* gfortran.dg/dummy_optional_arg.f90: New test.
2010-09-09 Steven G. Kargl <kargl@gcc.gnu.org>
* fortran/expr.c (check_inquiry): OPTIONAL attribute is not allowed
for dummy argument that appears in a specification statement.
From-SVN: r164120
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r-- | gcc/fortran/expr.c | 6 |
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; |