diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2013-03-10 13:23:58 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2013-03-10 13:23:58 +0000 |
commit | 8ec4321fafac5e8c03b80904a4a46d85efb115d6 (patch) | |
tree | 3bca7c6bfeb4752caf475053c6a76a4a2555bbc1 /gcc/fortran/expr.c | |
parent | d16d44d338c7e4632e1d34bca0351f9dbab126de (diff) | |
download | gcc-8ec4321fafac5e8c03b80904a4a46d85efb115d6.zip gcc-8ec4321fafac5e8c03b80904a4a46d85efb115d6.tar.gz gcc-8ec4321fafac5e8c03b80904a4a46d85efb115d6.tar.bz2 |
re PR fortran/56575 (An invalid OO code causes ICE)
2013-03-10 Paul Thomas <pault@gcc.gnu.org>
PR fortran/56575
* expr.c (gfc_default_initializer): Check that a class declared
type has any components.
* resolve.c (resolve_fl_derived0): On failing the test for C437
set the type to BT_UNKNOWN to prevent repeat error messages.
2013-03-10 Paul Thomas <pault@gcc.gnu.org>
PR fortran/56575
* gfortran.dg/class_56.f90: New test.
From-SVN: r196580
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r-- | gcc/fortran/expr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index fd17a05..1b74a44 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -3886,7 +3886,8 @@ gfc_default_initializer (gfc_typespec *ts) types (otherwise we could use gfc_has_default_initializer()). */ for (comp = ts->u.derived->components; comp; comp = comp->next) if (comp->initializer || comp->attr.allocatable - || (comp->ts.type == BT_CLASS && CLASS_DATA (comp)->attr.allocatable)) + || (comp->ts.type == BT_CLASS && CLASS_DATA (comp) + && CLASS_DATA (comp)->attr.allocatable)) break; if (!comp) |