Commit f637ebc1 by Tobias Burnus Committed by Tobias Burnus

re PR fortran/58658 ([OOP] Pointer assignment to allocatable unlimited polymorphic accepted)

2013-10-14  Tobias Burnus  <burnus@net-b.de>

        PR fortran/58658
        * expr.c (gfc_check_vardef_context): Fix pointer diagnostic
        for CLASS(*).

2013-10-14  Tobias Burnus  <burnus@net-b.de>

        PR fortran/58658
        * gfortran.dg/unlimited_polymorphic_10.f90: New.

From-SVN: r203572
parent 47e0da37
2013-10-14 Tobias Burnus <burnus@net-b.de>
PR fortran/58658
* expr.c (gfc_check_vardef_context): Fix pointer diagnostic
for CLASS(*).
2013-10-11 Jakub Jelinek <jakub@redhat.com> 2013-10-11 Jakub Jelinek <jakub@redhat.com>
* trans-openmp.c (gfc_omp_clause_default_ctor, * trans-openmp.c (gfc_omp_clause_default_ctor,
......
...@@ -4693,7 +4693,6 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj, ...@@ -4693,7 +4693,6 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj,
bool is_pointer; bool is_pointer;
bool check_intentin; bool check_intentin;
bool ptr_component; bool ptr_component;
bool unlimited;
symbol_attribute attr; symbol_attribute attr;
gfc_ref* ref; gfc_ref* ref;
int i; int i;
...@@ -4709,8 +4708,6 @@ gfc_check_vardef_context (gfc_expr* e, bool pointer, bool alloc_obj, ...@@ -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; 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); attr = gfc_expr_attr (e);
if (!pointer && e->expr_type == EXPR_FUNCTION && attr.pointer) 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, ...@@ -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 /* Find out whether the expr is a pointer; this also means following
component references to the last one. */ component references to the last one. */
is_pointer = (attr.pointer || attr.proc_pointer); is_pointer = (attr.pointer || attr.proc_pointer);
if (pointer && !is_pointer && !unlimited) if (pointer && !is_pointer)
{ {
if (context) if (context)
gfc_error ("Non-POINTER in pointer association context (%s)" gfc_error ("Non-POINTER in pointer association context (%s)"
......
2013-10-14 Tobias Burnus <burnus@net-b.de>
PR fortran/58658
* gfortran.dg/unlimited_polymorphic_10.f90: New.
2013-10-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 2013-10-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* gcc.dg/torture/pr58670.c (ASM_STR) [__i386__ || __x86_64__]: Use * gcc.dg/torture/pr58670.c (ASM_STR) [__i386__ || __x86_64__]: Use
......
! { dg-do compile }
!
! PR fortran/58658
!
! Contributed by Vladimír Fuka
!
subroutine sub(a)
class(*),allocatable :: a
a => null() ! { dg-error "Non-POINTER in pointer association context \\(pointer assignment\\)" }
end subroutine
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment