diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2006-12-28 18:41:25 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2006-12-28 18:41:25 +0000 |
commit | c5bfb0451df393fe3daedd21ed2619eb5f7f5f20 (patch) | |
tree | a28afc0cc08c6dc17b6c44c8ed834075cf7263b5 /gcc/fortran/resolve.c | |
parent | 975a4fc1a3818c84aafa85aa49915426305f7ae5 (diff) | |
download | gcc-c5bfb0451df393fe3daedd21ed2619eb5f7f5f20.zip gcc-c5bfb0451df393fe3daedd21ed2619eb5f7f5f20.tar.gz gcc-c5bfb0451df393fe3daedd21ed2619eb5f7f5f20.tar.bz2 |
re PR fortran/30034 ([4.1 only] pure subroutine requires intent for procedure argument)
2006-12-28 Paul Thomas <pault@gcc.gnu.org>
PR fortran/30034
* resolve.c (resolve_formal_arglist): Exclude the test for
pointers and procedures for subroutine arguments as well as
functions.
PR fortran/30237
* intrinsic.c (remove_nullargs): Do not pass up arguments with
a label. If the actual has a label and the formal has a type
then emit an error.
2006-12-28 Paul Thomas <pault@gcc.gnu.org>
PR fortran/30034
* gfortran.dg/pure_formal_proc_1.f90: New test.
PR fortran/30237
* gfortran.dg/intrinsic_actual_3.f90: New test.
From-SVN: r120244
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 9794446..2c71ae4 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -173,26 +173,20 @@ resolve_formal_arglist (gfc_symbol * proc) if (sym->attr.flavor == FL_UNKNOWN) gfc_add_flavor (&sym->attr, FL_VARIABLE, sym->name, &sym->declared_at); - if (gfc_pure (proc)) + if (gfc_pure (proc) && !sym->attr.pointer + && sym->attr.flavor != FL_PROCEDURE) { - if (proc->attr.function && !sym->attr.pointer - && sym->attr.flavor != FL_PROCEDURE - && sym->attr.intent != INTENT_IN) - + if (proc->attr.function && sym->attr.intent != INTENT_IN) gfc_error ("Argument '%s' of pure function '%s' at %L must be " "INTENT(IN)", sym->name, proc->name, &sym->declared_at); - if (proc->attr.subroutine && !sym->attr.pointer - && sym->attr.intent == INTENT_UNKNOWN) - - gfc_error - ("Argument '%s' of pure subroutine '%s' at %L must have " - "its INTENT specified", sym->name, proc->name, - &sym->declared_at); + if (proc->attr.subroutine && sym->attr.intent == INTENT_UNKNOWN) + gfc_error ("Argument '%s' of pure subroutine '%s' at %L must " + "have its INTENT specified", sym->name, proc->name, + &sym->declared_at); } - if (gfc_elemental (proc)) { if (sym->as != NULL) |