primary.c (gfc_match_structure_constructor): Invert the assert logic.
authorMikael Morin <mikael@gcc.gnu.org>
Wed, 6 Oct 2010 14:47:40 +0000 (14:47 +0000)
committerMikael Morin <mikael@gcc.gnu.org>
Wed, 6 Oct 2010 14:47:40 +0000 (14:47 +0000)
2010-10-06  Mikael Morin  <mikael@gcc.gnu.org>

* primary.c (gfc_match_structure_constructor): Invert the assert logic.

From-SVN: r165033

gcc/fortran/ChangeLog
gcc/fortran/primary.c

index c75bb8b77244cfd3dbb8ae655b3f6152144b9f59..86175478a9ce969135e2ae173d59b3e6d4b75d46 100644 (file)
@@ -1,3 +1,7 @@
+2010-10-06  Mikael Morin  <mikael@gcc.gnu.org>
+
+       * primary.c (gfc_match_structure_constructor): Invert the assert logic.
+
 2010-10-06  Mikael Morin  <mikael@gcc.gnu.org>
 
        * primary.c (gfc_free_structure_ctor_component): Also free the
index 9d0deec0c8f432411a44af0943a70ec46f67c9b3..054c66f35dc439256c3cf7100e3644ebffb2216e 100644 (file)
@@ -2414,8 +2414,9 @@ gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result,
   /* No component should be left, as this should have caused an error in the
      loop constructing the component-list (name that does not correspond to any
      component in the structure definition).  */
-  if (comp_head && sym->attr.extension)
+  if (comp_head)
     {
+      gcc_assert (sym->attr.extension);
       for (comp_iter = comp_head; comp_iter; comp_iter = comp_iter->next)
        {
          gfc_error ("component '%s' at %L has already been set by a "
@@ -2424,8 +2425,6 @@ gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result,
        }
       goto cleanup;
     }
-  else
-    gcc_assert (!comp_head);
 
   e = gfc_get_structure_constructor_expr (BT_DERIVED, 0, &where);
   e->ts.u.derived = sym;