summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/typebound_proc_28.f03
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/typebound_proc_28.f03')
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_proc_28.f0330
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_28.f03 b/gcc/testsuite/gfortran.dg/typebound_proc_28.f03
new file mode 100644
index 00000000000..74199c343fa
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_proc_28.f03
@@ -0,0 +1,30 @@
+! { dg-do compile }
+!
+! PR 56266: [OOP] ICE on invalid in gfc_match_varspec
+!
+! Contributed by Andrew Benson <abensonca@gmail.com>
+
+module t
+
+ implicit none
+
+ type nc
+ contains
+ procedure :: encM => em
+ end type nc
+
+contains
+
+ double precision function em(self)
+ class(nc) :: self
+ em=0.
+ end function
+
+ double precision function cem(c)
+ type(nc) :: c
+ cem=c(i)%encM() ! { dg-error "Unclassifiable statement" }
+ end function
+
+end module
+
+! { dg-final { cleanup-modules "t" } }