Commit f69ab0e0 by Jerry DeLisle

re PR fortran/34227 (initialized symbol in COMMON: Missing checks)

2007-11-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/34227
	* match.c (gfc_match_common): Add additional check for BLOCK DATA.

From-SVN: r130483
parent 9ffb37ce
2007-11-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/34227
* match.c (gfc_match_common): Add additional check for BLOCK DATA.
2007-11-27 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29389
......
......@@ -2783,6 +2783,16 @@ gfc_match_common (void)
goto cleanup;
}
if (((sym->value != NULL && sym->value->expr_type != EXPR_NULL)
|| sym->attr.data) && gfc_current_state () != COMP_BLOCK_DATA)
{
if (gfc_notify_std (GFC_STD_GNU, "Initialized symbol '%s' at %C "
"can only be COMMON in "
"BLOCK DATA", sym->name)
== FAILURE)
goto cleanup;
}
if (gfc_add_in_common (&sym->attr, sym->name, NULL) == FAILURE)
goto cleanup;
......
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