diff options
author | Janus Weil <janus@gcc.gnu.org> | 2012-10-11 19:52:36 +0200 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2012-10-11 19:52:36 +0200 |
commit | e87924ab48d86b6bf33ae6f33a6e4a0941fca970 (patch) | |
tree | 4bb45a2915d953234dbef2ea935ebf4ab60b699b /gcc/testsuite | |
parent | a1dc74f2bf02aa753939071fbd6d82f8db157e66 (diff) | |
download | gcc-e87924ab48d86b6bf33ae6f33a6e4a0941fca970.zip gcc-e87924ab48d86b6bf33ae6f33a6e4a0941fca970.tar.gz gcc-e87924ab48d86b6bf33ae6f33a6e4a0941fca970.tar.bz2 |
re PR fortran/54784 ([OOP] wrong code in polymorphic allocation with SOURCE)
2012-10-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/54784
* trans-stmt.c (gfc_trans_allocate): Correctly determine the reference
to the _data component for polymorphic allocation with SOURCE.
2012-10-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/54784
* gfortran.dg/class_allocate_13.f90: New.
From-SVN: r192374
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/class_allocate_13.f90 | 31 |
2 files changed, 36 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f618085..ff44d48 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-10-11 Janus Weil <janus@gcc.gnu.org> + + PR fortran/54784 + * gfortran.dg/class_allocate_13.f90: New. + 2012-10-11 Jason Merrill <jason@redhat.com> * g++.dg/ext/visibility/pragma-override1.C: Fix target markup. diff --git a/gcc/testsuite/gfortran.dg/class_allocate_13.f90 b/gcc/testsuite/gfortran.dg/class_allocate_13.f90 new file mode 100644 index 0000000..64f37dc --- /dev/null +++ b/gcc/testsuite/gfortran.dg/class_allocate_13.f90 @@ -0,0 +1,31 @@ +! { dg-do run } +! +! PR 54784: [4.7/4.8 Regression] [OOP] wrong code in polymorphic allocation with SOURCE +! +! Contributed by Jeremy Kozdon <jkozdon@gmail.com> + +program bug + implicit none + + type :: block + real, allocatable :: fields + end type + + type :: list + class(block),allocatable :: B + end type + + type :: domain + type(list),dimension(2) :: L + end type + + type(domain) :: d + type(block) :: b1 + + allocate(b1%fields,source=5.) + + allocate(d%L(2)%B,source=b1) ! wrong code + + if (d%L(2)%B%fields/=5.) call abort() + +end program |