summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/class_39.f03
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/class_39.f03')
-rw-r--r--gcc/testsuite/gfortran.dg/class_39.f0313
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/class_39.f03 b/gcc/testsuite/gfortran.dg/class_39.f03
new file mode 100644
index 000000000..bc8039fc0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_39.f03
@@ -0,0 +1,13 @@
+! { dg-do compile }
+!
+! PR 47745: [OOP] Segfault with CLASS(*) and derived type dummy arguments
+!
+! Contributed by Rodney Polkinghorne <thisrod@gmail.com>
+
+ type, abstract :: T
+ end type T
+contains
+ class(T) function add() ! { dg-error "must be dummy, allocatable or pointer" }
+ add = 1 ! { dg-error "Variable must not be polymorphic in assignment" }
+ end function
+end