Commit cb1d4dce by Steven G. Kargl Committed by Steven G. Kargl

re PR fortran/21257 ([4.0 only] Duplicate use of construct name)

	PR fortran/21257
	(Ported from g95)
	* match.c (gfc_match_label): Detect duplicate labels.

From-SVN: r101214
parent 8c98e9d0
2005-06-20 Erik Edelmann <erik.edelmann@iki.fi>
2005-06-20 Steven G. Kargl <kargls@comcast.net.
(port from g95)
PR fortran/21257
* match.c (gfc_match_label): Detect duplicate labels.
2005-06-20 Erik Edelmann <erik.edelmann@iki.fi>
* intrinsic.c (check_intrinsic_standard): Fix spelling error
in a warning message.
......
......@@ -250,7 +250,6 @@ match
gfc_match_label (void)
{
char name[GFC_MAX_SYMBOL_LEN + 1];
gfc_state_data *p;
match m;
gfc_new_block = NULL;
......@@ -265,18 +264,15 @@ gfc_match_label (void)
return MATCH_ERROR;
}
if (gfc_new_block->attr.flavor != FL_LABEL
&& gfc_add_flavor (&gfc_new_block->attr, FL_LABEL,
gfc_new_block->name, NULL) == FAILURE)
return MATCH_ERROR;
if (gfc_new_block->attr.flavor == FL_LABEL)
{
gfc_error ("Duplicate construct label '%s' at %C", name);
return MATCH_ERROR;
}
for (p = gfc_state_stack; p; p = p->previous)
if (p->sym == gfc_new_block)
{
gfc_error ("Label %s at %C already in use by a parent block",
gfc_new_block->name);
return MATCH_ERROR;
}
if (gfc_add_flavor (&gfc_new_block->attr, FL_LABEL,
gfc_new_block->name, NULL) == FAILURE)
return MATCH_ERROR;
return MATCH_YES;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment