http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58175
Bug ID: 58175 Summary: Incorrect warning message on scalar finalizor Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: abensonca at gmail dot com With gfortran 4.9.0 (r201776) the following causes an incorrect warning message to be issued: module ct type :: a contains final :: aD end type a contains subroutine aD(self) type(a), intent(inout) :: self end subroutine aD end module ct program test use ct end program test $ gfortran -v Using built-in specs. COLLECT_GCC=gfortran COLLECT_LTO_WRAPPER=/home/abenson/Galacticus/Tools/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-trunk/configure --prefix=/home/abenson/Galacticus/Tools --enable-languages=c,c++,fortran --disable-multilib --with-gmp=/home/abenson/Galacticus/Tools Thread model: posix gcc version 4.9.0 20130815 (experimental) (GCC) $ gfortran -c bug1.F90 -o bug1.o -Wall bug1.F90:12.6: use ct 1 Warning: Only array FINAL procedures declared for derived type 'a' defined at (1), suggest also scalar one bug1.F90:7.20: subroutine aD(self) 1 Warning: Unused dummy argument 'self' at (1) Only a scalar finalizor is present, but the warning suggests that an array but no scalar finalizor is present. The warning is only issued if the "ct" module is USEd. Adding an array finalizor or making the scalar finalizor ELEMENTAL does not change the warning message.