aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr38351.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/pr38351.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/pr38351.f9021
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/pr38351.f90 b/gcc/testsuite/gfortran.dg/pr38351.f90
new file mode 100644
index 00000000000..08e1724dc0a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr38351.f90
@@ -0,0 +1,21 @@
+! { dg-do compile }
+module m1
+ type t1
+ integer :: i
+ end type t1
+ interface operator(+)
+ module procedure add
+ end interface
+ contains
+ type(t1) function add(a,b)
+ type(t1), intent(in) :: a,b
+ end function
+end module m1
+
+program foo
+ use m1
+ type(t1), dimension(2,2) :: a = t1(1), b = t1(2)
+ type(t1) :: c=t1(1), d=t1(2)
+ c = c + d
+ a = a + b ! { dg-error "Unexpected derived-type entities" }
+end program foo