Commit a8267f8d by Tobias Burnus Committed by Tobias Burnus

re PR fortran/58652 (ICE with move_alloc and unlimited polymorphic)

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

        PR fortran/58652
        * interface.c (compare_parameter): Accept passing CLASS(*)
        to CLASS(*).

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

        PR fortran/58652
        * gfortran.dg/unlimited_polymorphic_12.f90: New.

From-SVN: r203720
parent 93151914
2013-10-16 Tobias Burnus <burnus@net-b.de> 2013-10-16 Tobias Burnus <burnus@net-b.de>
PR fortran/58652
* interface.c (compare_parameter): Accept passing CLASS(*)
to CLASS(*).
2013-10-16 Tobias Burnus <burnus@net-b.de>
* intrinsic.texi (OpenMP Modules): Update to OpenMPv4. * intrinsic.texi (OpenMP Modules): Update to OpenMPv4.
Document omp_proc_bind_kind. Document omp_proc_bind_kind.
......
...@@ -1990,8 +1990,9 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual, ...@@ -1990,8 +1990,9 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual,
if (!gfc_expr_attr (actual).class_ok) if (!gfc_expr_attr (actual).class_ok)
return 0; return 0;
if (!gfc_compare_derived_types (CLASS_DATA (actual)->ts.u.derived, if ((!UNLIMITED_POLY (formal) || !UNLIMITED_POLY(actual))
CLASS_DATA (formal)->ts.u.derived)) && !gfc_compare_derived_types (CLASS_DATA (actual)->ts.u.derived,
CLASS_DATA (formal)->ts.u.derived))
{ {
if (where) if (where)
gfc_error ("Actual argument to '%s' at %L must have the same " gfc_error ("Actual argument to '%s' at %L must have the same "
......
2013-10-16 Tobias Burnus <burnus@net-b.de>
PR fortran/58652
* gfortran.dg/unlimited_polymorphic_12.f90: New.
2013-10-16 Thomas Schwinge <thomas@codesourcery.com> 2013-10-16 Thomas Schwinge <thomas@codesourcery.com>
* c-c++-common/cpp/openmp-define-1.c: Move * c-c++-common/cpp/openmp-define-1.c: Move
......
! { dg-do compile }
!
! PR fortran/58652
!
! Contributed by Vladimir Fuka
!
! The passing of a CLASS(*) to a CLASS(*) was reject before
!
module gen_lists
type list_node
class(*),allocatable :: item
contains
procedure :: move_alloc => list_move_alloc
end type
contains
subroutine list_move_alloc(self,item)
class(list_node),intent(inout) :: self
class(*),intent(inout),allocatable :: item
call move_alloc(item, self%item)
end subroutine
end module
module lists
use gen_lists, only: node => list_node
end module lists
module sexp
use lists
contains
subroutine parse(ast)
class(*), allocatable, intent(out) :: ast
class(*), allocatable :: expr
integer :: ierr
allocate(node::ast)
select type (ast)
type is (node)
call ast%move_alloc(expr)
end select
end subroutine
end module
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