Peter Klausler b6316294be
[flang] Accept FINAL forward reference to separate module procedure
When one of a derived type's FINAL procedures is in a submodule,
its separate module procedure interface must necessarily be a
forward reference from the FINAL statement, as its interface
could not appear before the definition of the type.  The implementation
of FINAL procedure name resolution doesn't work for forward references;
replace it.

Differential Revision: https://reviews.llvm.org/D159035
2023-08-29 13:37:09 -07:00

20 lines
548 B
Fortran

! RUN: %python %S/test_symbols.py %s %flang_fc1
!DEF: /m Module
module m
!DEF: /m/t PUBLIC DerivedType
type :: t
contains
!DEF: /m/forwardreferenced ELEMENTAL, IMPURE, MODULE, PUBLIC (Subroutine) Subprogram
final :: forwardreferenced
end type
interface
!REF: /m/forwardreferenced
!DEF: /m/forwardreferenced/this INTENT(INOUT) ObjectEntity TYPE(t)
impure elemental module subroutine forwardreferenced (this)
!REF: /m/t
!REF: /m/forwardreferenced/this
type(t), intent(inout) :: this
end subroutine
end interface
end module