diff options
author | Janus Weil <janus@gcc.gnu.org> | 2008-08-14 23:15:59 +0200 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2008-08-14 23:15:59 +0200 |
commit | beb4bd6cf682a67cae7155eaebeea1b99229ab31 (patch) | |
tree | aa78450fe0cbc47d0224c6648e10b150996475c1 /gcc/fortran | |
parent | 157b0647a507b589d7651b80fe55275df54cead4 (diff) | |
download | gcc-beb4bd6cf682a67cae7155eaebeea1b99229ab31.zip gcc-beb4bd6cf682a67cae7155eaebeea1b99229ab31.tar.gz gcc-beb4bd6cf682a67cae7155eaebeea1b99229ab31.tar.bz2 |
re PR fortran/36705 (Procedure pointers with attributes statements)
2008-08-14 Janus Weil <janus@gcc.gnu.org>
PR fortran/36705
* symbol.c (check_conflict): Move conflict checks for (procedure,save)
and (procedure,intent) to resolve_fl_procedure.
* resolve.c (resolve_fl_procedure): Ditto.
2008-08-14 Janus Weil <janus@gcc.gnu.org>
PR fortran/36705
* gfortran.dg/argument_checking_7.f90: Modified.
* gfortran.dg/conflicts.f90: Modified.
* gfortran.dg/proc_decl_1.f90: Modified.
* gfortran.dg/proc_ptr_9.f90: New.
From-SVN: r139116
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/resolve.c | 14 | ||||
-rw-r--r-- | gcc/fortran/symbol.c | 12 |
3 files changed, 25 insertions, 8 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 3bdfb52..3ea6c32 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2008-08-14 Janus Weil <janus@gcc.gnu.org> + + PR fortran/36705 + * symbol.c (check_conflict): Move conflict checks for (procedure,save) + and (procedure,intent) to resolve_fl_procedure. + * resolve.c (resolve_fl_procedure): Ditto. + 2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR 36901 diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index c6a241a..994cb71 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -7443,6 +7443,20 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag) } } + if (sym->attr.save == SAVE_EXPLICIT && !sym->attr.proc_pointer) + { + gfc_error ("PROCEDURE attribute conflicts with SAVE attribute " + "in '%s' at %L", sym->name, &sym->declared_at); + return FAILURE; + } + + if (sym->attr.intent && !sym->attr.proc_pointer) + { + gfc_error ("PROCEDURE attribute conflicts with INTENT attribute " + "in '%s' at %L", sym->name, &sym->declared_at); + return FAILURE; + } + return SUCCESS; } diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 6b64bcf..d564dd7 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -417,12 +417,8 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where) goto conflict; case FL_PROCEDURE: - if (attr->proc_pointer) - break; - a1 = gfc_code2string (flavors, attr->flavor); - a2 = save; - goto conflict; - + /* Conflicts between SAVE and PROCEDURE will be checked at + resolution stage, see "resolve_fl_procedure". */ case FL_VARIABLE: case FL_NAMELIST: default: @@ -618,8 +614,8 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where) break; case FL_PROCEDURE: - if (!attr->proc_pointer) - conf2 (intent); + /* Conflicts with INTENT will be checked at resolution stage, + see "resolve_fl_procedure". */ if (attr->subroutine) { |