Commit bbf27208 by Dominique d'Humieres

[multiple changes]

2016-02-20  Dominique d'Humieres  <dominiq@lps.ens.fr>

	PR fortran/57365
	gfortran.dg/allocate_with_source_18.f03: New test.

2016-02-20  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/52531
	gfortran.dg/gomp/pr52531.f90: New test.

From-SVN: r233588
parent 34b18169
2016-02-20 Dominique d'Humieres <dominiq@lps.ens.fr>
PR fortran/57365
gfortran.dg/allocate_with_source_18.f03: New test.
2016-02-20 Harald Anlauf <anlauf@gmx.de>
PR fortran/52531
gfortran.dg/gomp/pr52531.f90: New test.
2016-02-19 Bernd Edlinger <bernd.edlinger@hotmail.de> 2016-02-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR c++/69865 PR c++/69865
......
! { dg-do run }
!
! PR fortran/57365
! [OOP] Sourced allocation fails with unlimited polymorphism
! Contributed by <rxs@hotmail.de>
!
program bug
implicit none
character(len=:), allocatable :: test
test = "A test case"
call allocate_test(test)
deallocate(test)
contains
subroutine allocate_test(var)
class(*) :: var
class(*), pointer :: copyofvar
allocate(copyofvar, source=var)
select type (copyofvar)
type is (character(len=*))
! print*, len(copyofvar), copyofvar
if (len(copyofvar) /= 11) call abort ()
if (copyofvar /= "A test case") call abort ()
end select
deallocate(copyofvar)
end subroutine
end program bug
! { dg-do compile }
! PR fortran/52531
module test_mod
type, public :: test_type
end type
contains
subroutine foo(bar)
type(test_type) :: bar
!$omp parallel default(none) shared(bar) ! Compiles if one removes default(none)
call question(bar)
!$omp end parallel
end subroutine
subroutine question(var)
class(test_type), intent(in) :: var ! Compiles if one replaces class by type
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