annotate gcc/testsuite/gfortran.dg/operator_7.f90 @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do compile }
kono
parents:
diff changeset
2 ! PR fortran/45786 - operators were not correctly marked as public
kono
parents:
diff changeset
3 ! if the alternative form was used.
kono
parents:
diff changeset
4 ! Test case contributed by Neil Carlson.
kono
parents:
diff changeset
5 module foo_type
kono
parents:
diff changeset
6 private
kono
parents:
diff changeset
7 public :: foo, operator(==)
kono
parents:
diff changeset
8 type :: foo
kono
parents:
diff changeset
9 integer :: bar
kono
parents:
diff changeset
10 end type
kono
parents:
diff changeset
11 interface operator(.eq.)
kono
parents:
diff changeset
12 module procedure eq_foo
kono
parents:
diff changeset
13 end interface
kono
parents:
diff changeset
14 contains
kono
parents:
diff changeset
15 logical function eq_foo (a, b)
kono
parents:
diff changeset
16 type(foo), intent(in) :: a, b
kono
parents:
diff changeset
17 eq_foo = (a%bar == b%bar)
kono
parents:
diff changeset
18 end function
kono
parents:
diff changeset
19 end module
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 subroutine use_it (a, b)
kono
parents:
diff changeset
22 use foo_type
kono
parents:
diff changeset
23 type(foo) :: a, b
kono
parents:
diff changeset
24 print *, a == b
kono
parents:
diff changeset
25 end subroutine