diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2020-12-05 14:14:19 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2020-12-05 14:14:19 +0000 |
commit | 7ae210d5db5eb96989b2f639e65678b5597e61f0 (patch) | |
tree | c9c644de187e048169a2817be36d4bdc6c4e9668 /gcc/fortran | |
parent | 1352bc88a0525743c952197fb2db6e4f8c091cde (diff) | |
download | gcc-7ae210d5db5eb96989b2f639e65678b5597e61f0.zip gcc-7ae210d5db5eb96989b2f639e65678b5597e61f0.tar.gz gcc-7ae210d5db5eb96989b2f639e65678b5597e61f0.tar.bz2 |
Fortran: flag formal argument before resolving an array spec [PR98016].
2020-12-05 Paul Thomas <pault@gcc.gnu.org>
gcc/fortran
PR fortran/98016
* resolve.c (resolve_symbol): Set formal_arg_flag before
resolving an array spec and restore value afterwards.
gcc/testsuite/
PR fortran/98016
* gfortran.dg/pr98016.f90: New test.
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/resolve.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index b6d21ad..0a8f907 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -15394,8 +15394,12 @@ resolve_symbol (gfc_symbol *sym) else if (mp_flag && sym->attr.flavor == FL_PROCEDURE && sym->attr.function) { bool saved_specification_expr = specification_expr; + bool saved_formal_arg_flag = formal_arg_flag; + specification_expr = true; + formal_arg_flag = true; gfc_resolve_array_spec (sym->result->as, false); + formal_arg_flag = saved_formal_arg_flag; specification_expr = saved_specification_expr; } |