diff mbox

[fortran,7/22] Various minor fixups

Message ID 20101005100948.1836.91089@gimli.local
State New
Headers show

Commit Message

Mikael Morin Oct. 5, 2010, 10:11 a.m. UTC
2010-10-04  Mikael Morin  <mikael@gcc.gnu.org>

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

Patch

diff --git a/primary.c b/primary.c
index f6ceae9..44b34a7 100644
--- a/primary.c
+++ b/primary.c
@@ -2413,8 +2413,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 "
@@ -2423,8 +2424,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;