diff options
author | Janus Weil <janus@gcc.gnu.org> | 2011-06-16 13:45:05 +0200 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2011-06-16 13:45:05 +0200 |
commit | 9c9eacb9b4d7b9f2866da3352e12722aedc846df (patch) | |
tree | b906177d151631ae9652bebb3a02f3f328d24096 /gcc/fortran/parse.c | |
parent | fd4df33d4ee706a8dbc98201b1a62456fabb8195 (diff) | |
download | gcc-9c9eacb9b4d7b9f2866da3352e12722aedc846df.zip gcc-9c9eacb9b4d7b9f2866da3352e12722aedc846df.tar.gz gcc-9c9eacb9b4d7b9f2866da3352e12722aedc846df.tar.bz2 |
re PR fortran/49417 ([OOP] ICE on invalid CLASS component declaration)
2011-06-16 Janus Weil <janus@gcc.gnu.org>
PR fortran/49417
* module.c (mio_component): Make sure the 'class_ok' attribute is set
for use-associated CLASS components.
* parse.c (parse_derived): Check for 'class_ok' attribute.
* resolve.c (resolve_fl_derived): Ditto.
2011-06-16 Janus Weil <janus@gcc.gnu.org>
PR fortran/49417
* gfortran.dg/class_43.f03: New.
From-SVN: r175101
Diffstat (limited to 'gcc/fortran/parse.c')
-rw-r--r-- | gcc/fortran/parse.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index 6013931..5ce5c1e 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -2120,13 +2120,15 @@ endType: { /* Look for allocatable components. */ if (c->attr.allocatable - || (c->ts.type == BT_CLASS && CLASS_DATA (c)->attr.allocatable) + || (c->ts.type == BT_CLASS && c->attr.class_ok + && CLASS_DATA (c)->attr.allocatable) || (c->ts.type == BT_DERIVED && c->ts.u.derived->attr.alloc_comp)) sym->attr.alloc_comp = 1; /* Look for pointer components. */ if (c->attr.pointer - || (c->ts.type == BT_CLASS && CLASS_DATA (c)->attr.class_pointer) + || (c->ts.type == BT_CLASS && c->attr.class_ok + && CLASS_DATA (c)->attr.class_pointer) || (c->ts.type == BT_DERIVED && c->ts.u.derived->attr.pointer_comp)) sym->attr.pointer_comp = 1; |