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
+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
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
&& !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
+2010-12-30 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47085
+ * gfortran.dg/allocate_class_1.f90: New.
+
2010-12-30 Kai Tietz <kai.tietz@onevision.com>
PR testsuite/47050
--- /dev/null
+! { dg-do compile }
+!
+! PR 47085: [OOP] Problem in allocate( SOURCE=) for polymorphic component
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+
+ type :: t0
+ end type
+ class(t0) :: x ! { dg-error "must be dummy, allocatable or pointer" }
+ allocate(x) ! { dg-error "is not a nonprocedure pointer or an allocatable variable" }
+ end