| 1 |
! { dg-do compile } |
| 2 |
! One of the tests of the patch for PR30068. |
| 3 |
! Taken from the fortran 2003 standard C11.2. |
| 4 |
! |
| 5 |
! The standard specifies that the optional arguments should be |
| 6 |
! ignored in the counting of like type/kind, so the specific |
| 7 |
! procedures below are invalid, even though actually unambiguous. |
| 8 |
! |
| 9 |
INTERFACE BAD8 |
| 10 |
SUBROUTINE S8A(X,Y,Z) ! { dg-error "Ambiguous interfaces" } |
| 11 |
REAL,OPTIONAL :: X |
| 12 |
INTEGER :: Y |
| 13 |
REAL :: Z |
| 14 |
END SUBROUTINE S8A |
| 15 |
SUBROUTINE S8B(X,Z,Y) ! { dg-error "Ambiguous interfaces" } |
| 16 |
INTEGER,OPTIONAL :: X |
| 17 |
INTEGER :: Z |
| 18 |
REAL :: Y |
| 19 |
END SUBROUTINE S8B |
| 20 |
END INTERFACE BAD8 |
| 21 |
real :: a, b |
| 22 |
integer :: i, j |
| 23 |
call bad8(x,i,b) |
| 24 |
end |