OSDN Git Service

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