From 1b034a958d4255f1cf57463655b9c74ec1e329bb Mon Sep 17 00:00:00 2001 From: Jerry DeLisle Date: Sun, 14 Jul 2019 22:52:58 +0000 Subject: re PR fortran/87233 (Constraint C1279 still followed after f2008 standard revision (?)) 2019-07-14 Jerry DeLisle PR fortran/87233 * expr.c (check_restricted): Relax constraint C1279 which was removed from F2008 and above. * gfortran.dg/initialization_14.f90: Modify to now pass by removing two dg-error commands. Added comments. * gfortran.dg/initialization_30.f90: New test that includes the two tests removed above with the 'dg-options -std=f95'. From-SVN: r273484 --- gcc/fortran/expr.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'gcc/fortran/expr.c') diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index ec9e328..a164370 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -3305,12 +3305,14 @@ check_restricted (gfc_expr *e) restricted expression in an elemental procedure, it will have already been simplified away once we get here. Therefore we don't need to jump through hoops to distinguish valid from - invalid cases. */ - if (sym->attr.dummy && sym->ns == gfc_current_ns + invalid cases. Allowed in F2008 and F2018. */ + if (gfc_notification_std (GFC_STD_F2008) + && sym->attr.dummy && sym->ns == gfc_current_ns && sym->ns->proc_name && sym->ns->proc_name->attr.elemental) { - gfc_error ("Dummy argument %qs not allowed in expression at %L", - sym->name, &e->where); + gfc_error_now ("Dummy argument %qs not " + "allowed in expression at %L", + sym->name, &e->where); break; } -- cgit v1.1