aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2011-06-16 13:45:05 +0200
committerJanus Weil <janus@gcc.gnu.org>2011-06-16 13:45:05 +0200
commit9c9eacb9b4d7b9f2866da3352e12722aedc846df (patch)
treeb906177d151631ae9652bebb3a02f3f328d24096 /gcc/fortran/resolve.c
parentfd4df33d4ee706a8dbc98201b1a62456fabb8195 (diff)
downloadgcc-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/resolve.c')
-rw-r--r--gcc/fortran/resolve.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index b2c3189..cec45ca 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -11789,7 +11789,8 @@ resolve_fl_derived (gfc_symbol *sym)
return FAILURE;
}
- if (c->ts.type == BT_CLASS && CLASS_DATA (c)->attr.class_pointer
+ if (c->ts.type == BT_CLASS && c->attr.class_ok
+ && CLASS_DATA (c)->attr.class_pointer
&& CLASS_DATA (c)->ts.u.derived->components == NULL
&& !CLASS_DATA (c)->ts.u.derived->attr.zero_comp)
{
@@ -11800,9 +11801,10 @@ resolve_fl_derived (gfc_symbol *sym)
}
/* C437. */
- if (c->ts.type == BT_CLASS
- && !(CLASS_DATA (c)->attr.class_pointer
- || CLASS_DATA (c)->attr.allocatable))
+ if (c->ts.type == BT_CLASS && c->attr.flavor != FL_PROCEDURE
+ && (!c->attr.class_ok
+ || !(CLASS_DATA (c)->attr.class_pointer
+ || CLASS_DATA (c)->attr.allocatable)))
{
gfc_error ("Component '%s' with CLASS at %L must be allocatable "
"or pointer", c->name, &c->loc);