https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79311
--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> --- Reduced test: module tensor_recursive implicit none type, public:: tens_signature_t contains final:: tens_signature_dtor end type tens_signature_t type, public:: tens_header_t type(tens_signature_t), private:: signature contains final:: tens_header_dtor end type tens_header_t contains subroutine tens_signature_dtor(this) implicit none type(tens_signature_t):: this end subroutine tens_signature_dtor subroutine tens_header_dtor(this) implicit none type(tens_header_t):: this end subroutine tens_header_dtor end module tensor_recursive The code compiles if one of the 'final:: ...' is removed.