aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorMark Eggleston <markeggleston@gcc.gnu.org>2020-06-10 07:22:50 +0100
committerMark Eggleston <markeggleston@gcc.gnu.org>2020-07-13 16:38:07 +0100
commitbae66e0f04323ba9d5daf60fcb997de925100e3e (patch)
treeb85b125c62a1c0023f5ebbcfafc9c23f8dad4160 /gcc/fortran/resolve.c
parent4fd124a23664c712f1bb1a7e91fa23fe83d72c0b (diff)
downloadgcc-bae66e0f04323ba9d5daf60fcb997de925100e3e.zip
gcc-bae66e0f04323ba9d5daf60fcb997de925100e3e.tar.gz
gcc-bae66e0f04323ba9d5daf60fcb997de925100e3e.tar.bz2
Fortran : accepts pointer initialization of DT dummy args PR45337
Initialisation of a variable results in an implicit save attribute being added to the variable. The save attribute is not allowed for variables with the dummy attribute set. Initialisation should be rejected for dummy variables. 2020-07-13 Mark Eggleston <markeggleston@gcc.gnu.org> gcc/fortran/ PR fortran/45337 * resolve.c (resolve_fl_variable): Remove type and intent checks from the check for dummy. 2020-07-13 Mark Eggleston <markeggleston@gcc.gnu.org> gcc/testsuite/ PR fortran/45337 * gfortran.dg/pr45337_1.f90: New test. * gfortran.dg/pr45337_2.f90: New test.
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index b1238c8..2751c0c 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -12927,8 +12927,7 @@ resolve_fl_variable (gfc_symbol *sym, int mp_flag)
else if (sym->attr.external)
gfc_error ("External %qs at %L cannot have an initializer",
sym->name, &sym->declared_at);
- else if (sym->attr.dummy
- && !(sym->ts.type == BT_DERIVED && sym->attr.intent == INTENT_OUT))
+ else if (sym->attr.dummy)
gfc_error ("Dummy %qs at %L cannot have an initializer",
sym->name, &sym->declared_at);
else if (sym->attr.intrinsic)