From 36ea267b8a5ed4ce63b864ce447e59ebc4e17bb6 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Fri, 28 Jan 2011 20:49:25 +0100 Subject: re PR fortran/47507 (PURE functions with VALUE arguments invalidly rejectd) 2011-01-28 Tobias Burnus PR fortran/47507 * resolve.c (resolve_formal_arglist): Allow arguments with VALUE attribute also without INTENT. 2011-01-28 Tobias Burnus PR fortran/47507 * gfortran.dg/pure_formal_1.f90: New. From-SVN: r169372 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/resolve.c | 12 +++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'gcc/fortran') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 336f28e..b706492 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,11 @@ 2011-01-28 Tobias Burnus + PR fortran/47507 + * resolve.c (resolve_formal_arglist): Allow arguments with VALUE + attribute also without INTENT. + +2011-01-28 Tobias Burnus + * gfortran.texi (Fortran 2003 status): Mention support for nonconstant namelist variables. diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 2436283..55b5183 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -338,15 +338,17 @@ resolve_formal_arglist (gfc_symbol *proc) if (gfc_pure (proc) && !sym->attr.pointer && sym->attr.flavor != FL_PROCEDURE) { - if (proc->attr.function && sym->attr.intent != INTENT_IN) + if (proc->attr.function && sym->attr.intent != INTENT_IN + && !sym->attr.value) gfc_error ("Argument '%s' of pure function '%s' at %L must be " - "INTENT(IN)", sym->name, proc->name, + "INTENT(IN) or VALUE", sym->name, proc->name, &sym->declared_at); - if (proc->attr.subroutine && sym->attr.intent == INTENT_UNKNOWN) + if (proc->attr.subroutine && sym->attr.intent == INTENT_UNKNOWN + && !sym->attr.value) gfc_error ("Argument '%s' of pure subroutine '%s' at %L must " - "have its INTENT specified", sym->name, proc->name, - &sym->declared_at); + "have its INTENT specified or have the VALUE " + "attribute", sym->name, proc->name, &sym->declared_at); } if (proc->attr.implicit_pure && !sym->attr.pointer -- cgit v1.1