5 ! ASSIGNMENT(=) checks. Defined assignment is allowed if and only if
6 ! it does not override an intrinsic assignment.
10 interface assignment(=)
11 module procedure valid
, valid2
14 ! Valid: scalar = array
15 subroutine valid (lhs
,rhs
)
16 integer, intent(out
) :: lhs
17 integer, intent(in
) :: rhs(:)
21 ! Valid: array of different ranks
22 subroutine valid2 (lhs
,rhs
)
23 integer, intent(out
) :: lhs(:)
24 integer, intent(in
) :: rhs(:,:)
30 interface assignment(=)
31 module procedure invalid
34 ! Invalid: scalar = scalar
35 subroutine invalid (lhs
,rhs
) ! { dg-error "must not redefine an INTRINSIC type assignment" }
36 integer, intent(out
) :: lhs
37 integer, intent(in
) :: rhs
39 end subroutine invalid
43 interface assignment(=)
44 module procedure invalid2
47 ! Invalid: array = scalar
48 subroutine invalid2 (lhs
,rhs
) ! { dg-error "must not redefine an INTRINSIC type assignment" }
49 integer, intent(out
) :: lhs(:)
50 integer, intent(in
) :: rhs
52 end subroutine invalid2
56 interface assignment(=)
57 module procedure invalid3
60 ! Invalid: array = array for same rank
61 subroutine invalid3 (lhs
,rhs
) ! { dg-error "must not redefine an INTRINSIC type assignment" }
62 integer, intent(out
) :: lhs(:)
63 integer, intent(in
) :: rhs(:)
65 end subroutine invalid3