+2016-11-30 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/78573
+ * decl.c (build_struct): On error, return directly and do not build
+ class symbol.
+
2016-11-29 Tobias Burnus <burnus@net-b.de>
PR fortran/58175
{
gfc_state_data *s;
gfc_component *c;
- bool t = true;
/* F03:C438/C439. If the current symbol is of the same derived type that we're
constructing, it must have the pointer attribute. */
{
gfc_error ("Pointer array component of structure at %C must have a "
"deferred shape");
- t = false;
+ return false;
}
}
else if (c->attr.allocatable)
{
gfc_error ("Allocatable component of structure at %C must have a "
"deferred shape");
- t = false;
+ return false;
}
}
else
{
gfc_error ("Array component of structure at %C must have an "
"explicit shape");
- t = false;
+ return false;
}
}
scalar:
if (c->ts.type == BT_CLASS)
- {
- bool t2 = gfc_build_class_symbol (&c->ts, &c->attr, &c->as);
+ return gfc_build_class_symbol (&c->ts, &c->attr, &c->as);
- if (t)
- t = t2;
- }
-
- return t;
+ return true;
}
--- /dev/null
+! { dg-do compile }
+!
+! PR 78573: [7 Regression] [OOP] ICE in resolve_component, at fortran/resolve.c:13405
+!
+! Contributed by Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de>
+
+program p
+ type t1
+ class(t2), pointer :: q(2) ! { dg-error "must have a deferred shape" }
+ end type
+end