aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/module.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/module.cc')
-rw-r--r--gcc/fortran/module.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/fortran/module.cc b/gcc/fortran/module.cc
index 070b316..e05b08bd 100644
--- a/gcc/fortran/module.cc
+++ b/gcc/fortran/module.cc
@@ -7277,10 +7277,13 @@ create_int_parameter_array (const char *name, int size, gfc_expr *value,
tmp_symtree = gfc_find_symtree (gfc_current_ns->sym_root, name);
if (tmp_symtree != NULL)
{
- if (strcmp (modname, tmp_symtree->n.sym->module) == 0)
+ if (tmp_symtree->n.sym->module &&
+ strcmp (modname, tmp_symtree->n.sym->module) == 0)
return;
else
- gfc_error ("Symbol %qs already declared", name);
+ gfc_error ("Symbol %qs already declared at %L conflicts with "
+ "symbol in %qs at %C", name,
+ &tmp_symtree->n.sym->declared_at, modname);
}
gfc_get_sym_tree (name, gfc_current_ns, &tmp_symtree, false);