aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/symbol.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/symbol.c')
-rw-r--r--gcc/fortran/symbol.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index 96e4cee..abd3b5c 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -3145,18 +3145,24 @@ gfc_new_symbol (const char *name, gfc_namespace *ns)
}
-/* Generate an error if a symbol is ambiguous. */
+/* Generate an error if a symbol is ambiguous, and set the error flag
+ on it. */
static void
ambiguous_symbol (const char *name, gfc_symtree *st)
{
+ if (st->n.sym->error)
+ return;
+
if (st->n.sym->module)
gfc_error ("Name %qs at %C is an ambiguous reference to %qs "
"from module %qs", name, st->n.sym->name, st->n.sym->module);
else
gfc_error ("Name %qs at %C is an ambiguous reference to %qs "
"from current program unit", name, st->n.sym->name);
+
+ st->n.sym->error = 1;
}