PR c/29467
[official-gcc.git] / gcc / testsuite / gfortran.dg / operator_2.f90
blob11540caaf8af5d32c56e01e338492ed10b706e52
1 ! { dg-do compile }
2 ! Test that we can't override intrinsic operators in invalid ways
3 module foo
5 interface operator(*)
6 module procedure f1 ! { dg-error "conflicts with intrinsic interface" }
7 end interface
9 interface operator(>)
10 module procedure f2 ! { dg-error "conflicts with intrinsic interface" }
11 end interface
13 interface operator(/)
14 module procedure f3
15 end interface
17 contains
19 function f1(a,b) result (c)
20 integer, intent(in) :: a
21 integer, dimension(:), intent(in) :: b
22 integer, dimension(size(b,1)) :: c
23 c = 0
24 end function f1
26 function f2(a,b)
27 character(len=*), intent(in) :: a
28 character(len=*), intent(in) :: b
29 logical :: f2
30 f2 = .false.
31 end function f2
33 function f3(a,b) result (c)
34 integer, dimension(:,:), intent(in) :: a
35 integer, dimension(:), intent(in) :: b
36 integer, dimension(size(b,1)) :: c
37 c = 0
38 end function f3
40 end