https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58175
Andrew Benson <abensonca at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED |--- --- Comment #15 from Andrew Benson <abensonca at gmail dot com> --- Hi Janus, The patch fixes most cases but, when compiling my full code I found some cases which still report the erroneous warning. These seem to be with cases where a derived type extends another derived type. For example, with gfortran 7.0.0 (r 242964) the following occurs: module ct type :: a contains final :: aD end type a type, extends(a) :: a1 contains end type a1 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-pc-linux-gnu/7.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-trunk/configure --prefix=/home/abenson/Galacticus/Tools --enable-languages=c,c++,fortran --disable-multilib Thread model: posix gcc version 7.0.0 20161129 (experimental) (GCC) $ gfortran -c bug.F90 -o bug.o -Wall bug.F90:7:24: type, extends(a) :: a1 1 Warning: Only array FINAL procedures declared for derived type 'a1' defined at (1), suggest also scalar one [-Wsurprising] bug.F90:16:6: use ct 1 Warning: Only array FINAL procedures declared for derived type 'a1' defined at (1), suggest also scalar one [-Wsurprising] bug.F90:11:20: subroutine aD(self) 1 Warning: Unused dummy argument 'self' at (1) [-Wunused-dummy-argument] So, there's no warning about the finalizer for type "a", but for type "a1" there's still a warning present.