diff options
author | Janus Weil <janus@gcc.gnu.org> | 2012-08-16 00:11:03 +0200 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2012-08-16 00:11:03 +0200 |
commit | 0b2d443bef10e972db37d28d4626ab8dbbf4abcc (patch) | |
tree | 6ab45128d591070c8fae12c6a1330ad520318450 /gcc/fortran | |
parent | 4b78ca9d8182bee10545a1f507b4fc39689d98b6 (diff) | |
download | gcc-0b2d443bef10e972db37d28d4626ab8dbbf4abcc.zip gcc-0b2d443bef10e972db37d28d4626ab8dbbf4abcc.tar.gz gcc-0b2d443bef10e972db37d28d4626ab8dbbf4abcc.tar.bz2 |
re PR fortran/54243 ([OOP] ICE (segfault) in gfc_type_compatible for invalid BT_CLASS)
2012-08-15 Janus Weil <janus@gcc.gnu.org>
PR fortran/54243
PR fortran/54244
* resolve.c (check_typebound_baseobject): Check for class_ok attribute.
(resolve_procedure_interface,resolve_fl_derived0): Copy class_ok
attribute.
2012-08-15 Janus Weil <janus@gcc.gnu.org>
PR fortran/54243
PR fortran/54244
* gfortran.dg/typebound_call_24.f03: New.
From-SVN: r190420
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/fortran/resolve.c | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 7161b62..17b14a9 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,11 @@ +2012-08-15 Janus Weil <janus@gcc.gnu.org> + + PR fortran/54243 + PR fortran/54244 + * resolve.c (check_typebound_baseobject): Check for class_ok attribute. + (resolve_procedure_interface,resolve_fl_derived0): Copy class_ok + attribute. + 2012-08-14 Mikael Morin <mikael@gcc.gnu.org> PR fortran/47586 diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index c706b89..ac5a362 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -237,6 +237,7 @@ resolve_procedure_interface (gfc_symbol *sym) sym->attr.always_explicit = ifc->attr.always_explicit; sym->attr.ext_attr |= ifc->attr.ext_attr; sym->attr.is_bind_c = ifc->attr.is_bind_c; + sym->attr.class_ok = ifc->attr.class_ok; /* Copy array spec. */ sym->as = gfc_copy_array_spec (ifc->as); if (sym->as) @@ -5795,6 +5796,9 @@ check_typebound_baseobject (gfc_expr* e) gcc_assert (base->ts.type == BT_DERIVED || base->ts.type == BT_CLASS); + if (base->ts.type == BT_CLASS && !gfc_expr_attr (base).class_ok) + return FAILURE; + /* F08:C611. */ if (base->ts.type == BT_DERIVED && base->ts.u.derived->attr.abstract) { @@ -11982,6 +11986,7 @@ resolve_fl_derived0 (gfc_symbol *sym) c->attr.recursive = ifc->attr.recursive; c->attr.always_explicit = ifc->attr.always_explicit; c->attr.ext_attr |= ifc->attr.ext_attr; + c->attr.class_ok = ifc->attr.class_ok; /* Replace symbols in array spec. */ if (c->as) { |