Similary to
D140209, the scope might need to be retrieved
from the typeSymbol. The test code was crashing because the
scope passed to CollectBindings was initially null.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/
D143188
info.loc, dtName,
parent ? Fortran::lower::mangle::mangleName(*parent) : "");
auto insertPt = builder.saveInsertionPoint();
-
+ const Fortran::semantics::Scope *scope = info.typeSpec->scope();
+ if (!scope)
+ scope = info.typeSpec->typeSymbol().scope();
Fortran::semantics::SymbolVector bindings =
- Fortran::semantics::CollectBindings(*info.typeSpec->scope());
+ Fortran::semantics::CollectBindings(*scope);
if (!bindings.empty())
builder.createBlock(&dt.getRegion());
procedure(nopass_defferred), deferred, nopass :: nopassd
end type
+ type :: node
+ type(node_ptr), pointer :: n(:)
+ end type
+ type :: use_node
+ type(node) :: n
+ end type
+ type :: node_ptr
+ type(node_ptr), pointer :: n
+ end type
+
contains
! ------------------------------------------------------------------------------
! CHECK: fir.call @_QMcall_dispatchPtbp_pass_arg0
! CHECK: fir.call @_QMcall_dispatchPtbp_pass_arg1
+ subroutine use_node_test(n)
+ type(use_node) :: n
+ end subroutine
+
end module