111
|
1 ! { dg-do compile }
|
|
2 ! PR fortran/45786 - operators were not correctly marked as public
|
|
3 ! if the alternative form was used.
|
|
4 ! Test case contributed by Neil Carlson.
|
|
5 module foo_type
|
|
6 private
|
|
7 public :: foo, operator(==)
|
|
8 type :: foo
|
|
9 integer :: bar
|
|
10 end type
|
|
11 interface operator(.eq.)
|
|
12 module procedure eq_foo
|
|
13 end interface
|
|
14 contains
|
|
15 logical function eq_foo (a, b)
|
|
16 type(foo), intent(in) :: a, b
|
|
17 eq_foo = (a%bar == b%bar)
|
|
18 end function
|
|
19 end module
|
|
20
|
|
21 subroutine use_it (a, b)
|
|
22 use foo_type
|
|
23 type(foo) :: a, b
|
|
24 print *, a == b
|
|
25 end subroutine
|