aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog7
-rw-r--r--gcc/fortran/resolve.c14
-rw-r--r--gcc/fortran/symbol.c12
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)
{