aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/symbol.c
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2009-04-06 10:33:31 +0200
committerJanus Weil <janus@gcc.gnu.org>2009-04-06 10:33:31 +0200
commit1d146030e28eb829762a0c888abf8733ec500b89 (patch)
tree9559bbc93d5db9e66bb147c44b2a1e1dac14cc6f /gcc/fortran/symbol.c
parent7d253f6e46182cfb4d2964d968f70989ca79118c (diff)
downloadgcc-1d146030e28eb829762a0c888abf8733ec500b89.zip
gcc-1d146030e28eb829762a0c888abf8733ec500b89.tar.gz
gcc-1d146030e28eb829762a0c888abf8733ec500b89.tar.bz2
re PR fortran/39414 (PROCEDURE statement double declaration bug)
2009-04-06 Janus Weil <janus@gcc.gnu.org> PR fortran/39414 * decl.c (match_procedure_decl): Fix double declaration problems with PROCEDURE statements. * symbol.c (gfc_add_type): Ditto. 2009-04-06 Janus Weil <janus@gcc.gnu.org> PR fortran/39414 * gfortran.dg/proc_decl_21.f90: New. From-SVN: r145583
Diffstat (limited to 'gcc/fortran/symbol.c')
-rw-r--r--gcc/fortran/symbol.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index 7888235..7414616 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -1555,8 +1555,7 @@ gfc_add_type (gfc_symbol *sym, gfc_typespec *ts, locus *where)
if (sym->ts.type != BT_UNKNOWN)
{
const char *msg = "Symbol '%s' at %L already has basic type of %s";
- if (!(sym->ts.type == ts->type
- && (sym->attr.flavor == FL_PROCEDURE || sym->attr.result))
+ if (!(sym->ts.type == ts->type && sym->attr.result)
|| gfc_notification_std (GFC_STD_GNU) == ERROR
|| pedantic)
{
@@ -1570,6 +1569,13 @@ gfc_add_type (gfc_symbol *sym, gfc_typespec *ts, locus *where)
gfc_warning (msg, sym->name, where, gfc_basic_typename (sym->ts.type));
}
+ if (sym->attr.procedure && sym->ts.interface)
+ {
+ gfc_error ("Procedure '%s' at %L may not have basic type of %s", sym->name, where,
+ gfc_basic_typename (ts->type));
+ return FAILURE;
+ }
+
flavor = sym->attr.flavor;
if (flavor == FL_PROGRAM || flavor == FL_BLOCK_DATA || flavor == FL_MODULE