Reproducible on Godbolt:
https://godbolt.org/z/3f1h6bW57
Reproducer:
```console
function f(x) result(res)
integer :: i
procedure() :: res
end function
```
With assertion-enabled flang-new, the following assertion failure was observed after "error: verification of lowering to FIR failed":
```txt
llvm-project/flang/include/flang/Lower/StatementContext.h:57: Fortran::lower::StatementContext::~StatementContext(): Assertion `cufs.empty() && "invalid StatementContext destructor call"' failed.
```
Reproducible on Godbolt:
https://godbolt.org/z/3f1h6bW57
Reproducer:
```console
function f(x) result(res)
integer :: i
procedure() :: res
end function
```
With assertion-enabled flang-new, the following assertion failure was observed after "error: verification of lowering to FIR failed":
```txt
llvm-project/flang/include/flang/Lower/StatementContext.h:57: Fortran::lower::StatementContext::~StatementContext(): Assertion `cufs.empty() && "invalid StatementContext destructor call"' failed.
```
Reproducible on Godbolt: https://godbolt.org/z/3f1h6bW57
Reproducer:
With assertion-enabled flang-new, the following assertion failure was observed after "error: verification of lowering to FIR failed":