diff options
author | janus <janus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-30 11:53:35 +0000 |
---|---|---|
committer | janus <janus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-30 11:53:35 +0000 |
commit | 538357ac69646e93a7146f491e4156af67b1da1a (patch) | |
tree | bef3e9e1852e6cf04b23e16f4eb7ab3a68eaed6e /gcc/fortran | |
parent | 9f75add7d92bc974cf7f3f026f40626317446550 (diff) | |
download | gcc-538357ac69646e93a7146f491e4156af67b1da1a.tar.gz |
2010-12-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/47085
* match.c (gfc_match_allocate): Check for 'class_ok'.
* primary.c (gfc_match_varspec): Ditto.
2010-12-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/47085
* gfortran.dg/allocate_class_1.f90: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168340 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/match.c | 2 | ||||
-rw-r--r-- | gcc/fortran/primary.c | 3 |
3 files changed, 9 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index e837b065c33..d9e91c7dc87 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2010-12-30 Janus Weil <janus@gcc.gnu.org> + + PR fortran/47085 + * match.c (gfc_match_allocate): Check for 'class_ok'. + * primary.c (gfc_match_varspec): Ditto. + 2010-12-29 Thomas Koenig <tkoenig@gcc.gnu.org> * dump_parse_tree.c (show_components): Show diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index 44da1bb97bd..a74fdb7fc98 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -2956,7 +2956,7 @@ gfc_match_allocate (void) b1 = !(tail->expr->ref && (tail->expr->ref->type == REF_COMPONENT || tail->expr->ref->type == REF_ARRAY)); - if (sym && sym->ts.type == BT_CLASS) + if (sym && sym->ts.type == BT_CLASS && sym->attr.class_ok) b2 = !(CLASS_DATA (sym)->attr.allocatable || CLASS_DATA (sym)->attr.class_pointer); else diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index da028b42df8..ed85398357a 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -1774,7 +1774,8 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag, && !gfc_is_proc_ptr_comp (primary, NULL) && !(gfc_matching_procptr_assignment && sym->attr.flavor == FL_PROCEDURE)) - || (sym->ts.type == BT_CLASS && CLASS_DATA (sym)->attr.dimension)) + || (sym->ts.type == BT_CLASS && sym->attr.class_ok + && CLASS_DATA (sym)->attr.dimension)) { /* In EQUIVALENCE, we don't know yet whether we are seeing an array, character variable or array of character |