From f637ebc1e8651f77b2f9853c1986b682839706e8 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Mon, 14 Oct 2013 19:26:17 +0200 Subject: re PR fortran/58658 ([OOP] Pointer assignment to allocatable unlimited polymorphic accepted) 2013-10-14 Tobias Burnus PR fortran/58658 * expr.c (gfc_check_vardef_context): Fix pointer diagnostic for CLASS(*). 2013-10-14 Tobias Burnus PR fortran/58658 * gfortran.dg/unlimited_polymorphic_10.f90: New. From-SVN: r203572 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/expr.c | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'gcc/fortran') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 583baa6..0515e6c 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2013-10-14 Tobias Burnus + + PR fortran/58658 + * expr.c (gfc_check_vardef_context): Fix pointer diagnostic + for CLASS(*). + 2013-10-11 Jakub Jelinek * trans-openmp.c (gfc_omp_clause_default_ctor, diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index b2af328..df96e5b 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -4693,7 +4693,6 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj, bool is_pointer; bool check_intentin; bool ptr_component; - bool unlimited; symbol_attribute attr; gfc_ref* ref; int i; @@ -4709,8 +4708,6 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj, sym = e->value.function.esym ? e->value.function.esym : e->symtree->n.sym; } - unlimited = e->ts.type == BT_CLASS && UNLIMITED_POLY (sym); - attr = gfc_expr_attr (e); if (!pointer && e->expr_type == EXPR_FUNCTION && attr.pointer) { @@ -4750,7 +4747,7 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj, /* Find out whether the expr is a pointer; this also means following component references to the last one. */ is_pointer = (attr.pointer || attr.proc_pointer); - if (pointer && !is_pointer && !unlimited) + if (pointer && !is_pointer) { if (context) gfc_error ("Non-POINTER in pointer association context (%s)" -- cgit v1.1