summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/class_59.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/class_59.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/class_59.f9025
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/class_59.f90 b/gcc/testsuite/gfortran.dg/class_59.f90
new file mode 100644
index 00000000000..e077ef8dc30
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_59.f90
@@ -0,0 +1,25 @@
+! { dg-do compile }
+!
+! PR 71894: [OOP] ICE in gfc_add_component_ref, at fortran/class.c:227
+!
+! Contributed by Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de>
+
+subroutine s1
+ type t
+ integer :: n
+ end type
+ type(t) :: x
+ class(t) :: y ! { dg-error "must be dummy, allocatable or pointer" }
+ x = y
+end
+
+subroutine s2
+ type t
+ end type
+ class(t) :: x ! { dg-error "must be dummy, allocatable or pointer" }
+ class(t), allocatable :: y
+ select type (y)
+ type is (t)
+ y = x
+ end select
+end