aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2008-03-16 19:14:17 +0000
committerPaul Thomas <pault@gcc.gnu.org>2008-03-16 19:14:17 +0000
commitc52938ec21193c37f7c1e76d0517dfe22620be94 (patch)
tree633db8190966c3533cf3b0b7a952b68a444f85c7 /gcc/testsuite/gfortran.dg
parent41ff0d66b3825f5efbc5bb0135c0348b5ff01244 (diff)
downloadgcc-c52938ec21193c37f7c1e76d0517dfe22620be94.zip
gcc-c52938ec21193c37f7c1e76d0517dfe22620be94.tar.gz
gcc-c52938ec21193c37f7c1e76d0517dfe22620be94.tar.bz2
re PR fortran/35470 (Valid pointer assigment code gives compilation errors)
2008-03-16 Paul Thomas <pault@gcc.gnu.org> PR fortran/35470 * resolve.c (check_assumed_size_reference): Only visit the first reference and look directly at the highest dimension. 2008-03-16 Paul Thomas <pault@gcc.gnu.org> PR fortran/35470 * gfortran.dg/subref_array_pointer_3.f90 : New test. From-SVN: r133279
Diffstat (limited to 'gcc/testsuite/gfortran.dg')
-rw-r--r--gcc/testsuite/gfortran.dg/subref_array_pointer_3.f9015
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/subref_array_pointer_3.f90 b/gcc/testsuite/gfortran.dg/subref_array_pointer_3.f90
new file mode 100644
index 0000000..b345c9d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/subref_array_pointer_3.f90
@@ -0,0 +1,15 @@
+! { dg-do compile }
+! Tests the fix for PR35470, in which the pointer assignment would fail
+! because the assumed size 'arr' would get mixed up with the component
+! 'p' in the check for the upper bound of an assumed size array.
+!
+! Contributed by Antony Lewis <antony@cosmologist.info>
+!
+subroutine sub(arr)
+ type real_pointer
+ real, pointer :: p(:)
+ end type real_pointer
+ type(real_pointer), dimension(*) :: arr
+ real, pointer :: p(:)
+ p => arr(1)%p
+end subroutine