aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorHarald Anlauf <anlauf@gmx.de>2020-10-27 20:25:23 +0100
committerHarald Anlauf <anlauf@gmx.de>2020-10-27 20:26:44 +0100
commita764c40079a493826a3678174f908941a383644e (patch)
treeeff05b3657ffb0042a50173a631b38a445b951f0 /gcc/fortran/resolve.c
parentedea991d2ca520906e7a9581248db5eb96b20ac2 (diff)
downloadgcc-a764c40079a493826a3678174f908941a383644e.zip
gcc-a764c40079a493826a3678174f908941a383644e.tar.gz
gcc-a764c40079a493826a3678174f908941a383644e.tar.bz2
PR fortran/97491 - Wrong restriction for VALUE arguments of pure procedures
A dummy argument with the VALUE attribute may be redefined in a PURE or ELEMENTAL procedure. Adjust the associated purity check. gcc/fortran/ChangeLog: * resolve.c (gfc_impure_variable): A dummy argument with the VALUE attribute may be redefined without making a procedure impure. gcc/testsuite/ChangeLog: * gfortran.dg/value_8.f90: New test.
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index a210f9a..93b918b 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -16476,6 +16476,7 @@ gfc_impure_variable (gfc_symbol *sym)
proc = sym->ns->proc_name;
if (sym->attr.dummy
+ && !sym->attr.value
&& ((proc->attr.subroutine && sym->attr.intent == INTENT_IN)
|| proc->attr.function))
return 1;