The following code is rejected my gfortran 9.0 (I also checked 5.4.0). It is accepted by nagfor 6.2 and ifort 18 and 19beta, but was rejected by ifort 17 with the same argument as by gfortran. It is rejected by PGI fortran v18.5. Apparently, it is from an interp F08/0052 in F2008 corrigendum one and was discussed by Ian Harvey on c.l.f. on July 5, 2016 under the topic "Interpretation F08/0052 (overriding private bindings) ". Somehow, ifort changed their minds to accept this code, so it is standard-compliant? MODULE example1_m1 TYPE t1 CONTAINS PROCEDURE,PRIVATE,NOPASS :: p ! (1). END TYPE t1 CONTAINS SUBROUTINE p PRINT *,'p' END SUBROUTINE p SUBROUTINE do_p(x) CLASS(t1) x CALL x%p END SUBROUTINE do_p END MODULE example1_m1 MODULE example1_m2 USE example1_m1 TYPE,EXTENDS(t1) :: t2 CONTAINS PROCEDURE,NOPASS :: p => p2 ! (2). END TYPE t2 CONTAINS SUBROUTINE p2(n) PRINT *,'p2',n END SUBROUTINE p2 END MODULE example1_m2 ~
This is the error message from gfortran: Error: 'p' at (1) must have the same number of formal arguments as the overridden procedure
Duplicate of pr47805. This has been discussed at https://groups.google.com/forum/#!topic/comp.lang.fortran/16Rane73lRI *** This bug has been marked as a duplicate of bug 47805 ***
Sorry, I should have scanned a little better for existing PRs.