1! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
2module m
3  public i
4  integer, private :: j
5  !ERROR: The accessibility of 'i' has already been specified as PUBLIC
6  private i
7  !The accessibility of 'j' has already been specified as PRIVATE
8  private j
9end
10
11module m2
12  interface operator(.foo.)
13    module procedure ifoo
14  end interface
15  public :: operator(.foo.)
16  !ERROR: The accessibility of operator '.foo.' has already been specified as PUBLIC
17  private :: operator(.foo.)
18  interface operator(+)
19    module procedure ifoo
20  end interface
21  public :: operator(+)
22  !ERROR: The accessibility of 'operator(+)' has already been specified as PUBLIC
23  private :: operator(+) , ifoo
24contains
25  integer function ifoo(x, y)
26    logical, intent(in) :: x, y
27  end
28end module
29
30module m3
31  type t
32  end type
33  private :: operator(.lt.)
34  interface operator(<)
35    logical function lt(x, y)
36      import t
37      type(t), intent(in) :: x, y
38    end function
39  end interface
40  !ERROR: The accessibility of 'operator(<)' has already been specified as PRIVATE
41  public :: operator(<)
42  interface operator(.gt.)
43    logical function gt(x, y)
44      import t
45      type(t), intent(in) :: x, y
46    end function
47  end interface
48  public :: operator(>)
49  !ERROR: The accessibility of 'operator(.gt.)' has already been specified as PUBLIC
50  private :: operator(.gt.)
51end
52