OSDN Git Service

2010-04-09 Tobias Burnus <burnus@net-b.de>
[pf3gnuchains/gcc-fork.git] / gcc / fortran / decl.c
index c527307..12dcf84 100644 (file)
@@ -3101,7 +3101,18 @@ match_attr_spec (void)
 
       if (d == DECL_DIMENSION || d == DECL_CODIMENSION)
        {
-         m = gfc_match_array_spec (&current_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)
            {
@@ -3115,20 +3126,6 @@ match_attr_spec (void)
          if (m == MATCH_ERROR)
            goto cleanup;
        }
-
-      if (d == DECL_CODIMENSION)
-       {
-         m = gfc_match_array_spec (&current_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