if (d == DECL_DIMENSION || d == DECL_CODIMENSION)
{
- m = gfc_match_array_spec (¤t_as, true, false);
+ gfc_array_spec *as = NULL;
+
+ m = gfc_match_array_spec (&as, d == DECL_DIMENSION,
+ d == DECL_CODIMENSION);
+
+ if (current_as == NULL)
+ current_as = as;
+ else if (m == MATCH_YES)
+ {
+ merge_array_spec (as, current_as, false);
+ gfc_free (as);
+ }
if (m == MATCH_NO)
{
if (m == MATCH_ERROR)
goto cleanup;
}
-
- if (d == DECL_CODIMENSION)
- {
- m = gfc_match_array_spec (¤t_as, false, true);
-
- if (m == MATCH_NO)
- {
- gfc_error ("Missing codimension specification at %C");
- m = MATCH_ERROR;
- }
-
- if (m == MATCH_ERROR)
- goto cleanup;
- }
}
/* Since we've seen a double colon, we have to be looking at an