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