aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr38351.f90
blob: 08e1724dc0a619ec1a6928177a1e1a3ef0eca23e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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