Commit 22c23886 by Paul Thomas

re PR fortran/63553 ([OOP] Wrong code when assigning a CLASS to a TYPE)

2014-10-18  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/63553
	* resolve.c (resolve_ordinary_assign): Add data component to
	rvalue expression for class to type assignment.

2014-10-18  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/63553
	* gfortran.dg/class_to_type_3.f03 : New test

From-SVN: r216427
parent 54157b52
2014-10-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/63553
* resolve.c (resolve_ordinary_assign): Add data component to
rvalue expression for class to type assignment.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* f95-lang.c: Adjust include files.
......
2014-10-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/63553
* gfortran.dg/class_to_type_3.f03 : New test
2014-10-18 Oleg Endo <olegendo@gcc.gnu.org>
* gcc.target/sh/torture/pr58314.c: Fix excess failures caused by switch
......@@ -757,7 +762,7 @@
* gcc.dg/winline-6.c: Likewise.
* gcc.dg/winline-7.c: Likewise.
* gcc.dg/funcorder.c: Fix implicit declarations. Fix defaulting to
int.
int.
* gcc.dg/inline-33.c: Likewise.
* gcc.dg/pr27861-1.c: Likewise.
* gcc.dg/pr28888.c: Likewise.
......@@ -3476,7 +3481,7 @@
2014-08-19 Janis Johnson <janisjo@codesourcery.com>
* lib/target-supports.exp
* lib/target-supports.exp
(check_effective_target_arm_v8_neon_ok_nocache): Add
"-march-armv8-a" to compile flags.
......
! { dg-do run }
! Tests the fix for pr63553 in which the class container was being
! assigned to derived types, rather than the data.
!
! Contributed by <patnel97269-gfortran@yahoo.fr>
!
program toto
implicit none
type mother
integer :: i
end type mother
type,extends(mother) :: child
end type child
call comment1
call comment2
contains
subroutine comment1
type(mother) :: tm
class(mother),allocatable :: cm
allocate (cm)
cm%i = 77
tm = cm
if (tm%i .ne. cm%i) call abort
end subroutine
subroutine comment2
class(mother),allocatable :: cm,cm2
allocate(cm)
allocate(child::cm2)
cm%i=10
select type (cm2)
type is (child)
cm2%mother=cm
end select
if (cm2%i .ne. cm%i) call abort
end subroutine
end program
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