Examples taken from the Fortran 2003 standard, Section C.11.2. They are not recognized as invalid.
* * * INTERFACE BAD8 ! this interface is invalid ! ! despite the fact that it is unambiguous ! SUBROUTINE S8A(X,Y,Z) REAL,OPTIONAL :: X INTEGER :: Y REAL :: Z END SUBROUTINE S8A SUBROUTINE S8B(X,Z,Y) INTEGER,OPTIONAL :: X INTEGER :: Z REAL :: Y END SUBROUTINE S8B END INTERFACE BAD8 This interface fails rule (3) because there are no required arguments that can be distinguished from the positionally corresponding argument, but in order for the mismatch of the optional arguments not to be relevant, the later arguments must be specified as keyword arguments, so distinguishing by name does the trick. This interface is nevertheless invalid so a standard-conforming Fortran processor is not required to do such reasoning. The rules to cover all cases are too complicated to be useful. * * * module x INTERFACE BAD9 ! this interface is invalid ! ! despite the fact that it is unambiguous ! SUBROUTINE S9A(X) REAL :: X END SUBROUTINE S9A SUBROUTINE S9B(X) INTERFACE FUNCTION X(A) REAL :: X,A END FUNCTION X END INTERFACE END SUBROUTINE S9B SUBROUTINE S9C(X) INTERFACE FUNCTION X(A) REAL :: X INTEGER :: A END FUNCTION X END INTERFACE END SUBROUTINE S9C END INTERFACE BAD9 end module x The real data objects that would be valid arguments for S9A are entirely disjoint from procedures that are valid arguments to S9B and S9C, and the procedures that valid arguments for S9B are disjoint from the procedures that are valid arguments to S9C because the former are required to accept real arguments and the latter integer arguments. Again, this interface is invalid, so a standard-conforming Fortran processor need not examine such properties when deciding whether a generic collection is valid. Again, the rules to cover all cases are too complicated to be useful. -- Summary: Ambigous interfaces not detected Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: accepts-invalid Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: burnus at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30068