http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54730
--- Comment #8 from Mikael Morin <mikael at gcc dot gnu.org> 2013-01-20
17:47:34 UTC ---
(In reply to comment #7)
> Untested patch:
>
Probably better (still not fully correct):
diff --git a/array.c b/array.c
index 6787c05..1641629 100644
--- a/array.c
+++ b/array.c
@@ -1074,7 +1074,8 @@ gfc_match_array_constructor (gfc_expr **result)
/* Try to match an optional "type-spec ::" */
gfc_clear_ts (&ts);
- if (gfc_match_decl_type_spec (&ts, 0) == MATCH_YES)
+ m = gfc_match_decl_type_spec (&ts, 0);
+ if (m == MATCH_YES)
{
seen_ts = (gfc_match (" ::") == MATCH_YES);
@@ -1092,6 +1093,8 @@ gfc_match_array_constructor (gfc_expr **result)
}
}
}
+ else if (m == MATCH_ERROR)
+ gfc_undo_symbols ();
if (! seen_ts)
gfc_current_locus = where;