gcc/testsuite/gfortran.dg/pr38351.f90
raw| 1 | ! { dg-do compile } |
| 2 | module m1 |
| 3 | type t1 |
| 4 | integer :: i |
| 5 | end type t1 |
| 6 | interface operator(+) |
| 7 | module procedure add |
| 8 | end interface |
| 9 | contains |
| 10 | type(t1) function add(a,b) |
| 11 | type(t1), intent(in) :: a,b |
| 12 | end function |
| 13 | end module m1 |
| 14 | |
| 15 | program foo |
| 16 | use m1 |
| 17 | type(t1), dimension(2,2) :: a = t1(1), b = t1(2) |
| 18 | type(t1) :: c=t1(1), d=t1(2) |
| 19 | c = c + d |
| 20 | a = a + b ! { dg-error "Unexpected derived-type entities" } |
| 21 | end program foo |