Open p4vook opened 11 months ago
I was able to get debug info:
clang-repl: /var/tmp/portage/sys-devel/clang-18.0.0_pre20231119/work/clang/include/clang/AST/DeclBase.h:1336: clang::NamedDecl* clang::DeclListNode::iterator::operator*() const: Assertion Ptr && "dereferencing end() iterator"' failed.
@EugeneZelenko are you sure clang-repl is clang-tools-extra? The repository layout suggests it's just a part of clang itself. Sorry for tag.
@p4vook: Is it separate binary? If so, it's not exactly clang
. If there are many issues related to it, it'll make sense to create dedicated label.
@p4vook, can you move the fix of this issue out of the bigger pull request and add a regression test for it?
Done
@p4vook, can you move the fix of this issue out of the bigger pull request and add a regression test for it?
I believe this is a deeper issue, it shouldn't be fixed up just by a simple check for nullptr, this seems to be an issue of inserting statements into wrong nodes of syntax tree if namespaces are present. I'll convert the PR to draft.
Minimal example
Expected result
Error is shown, but the evaluation continues
Actual result
Error is shown,
clang-repl
gets terminated by SIGSEGV.Stack trace
LLVM 17.0.4
Also tested with current master (commit 0d77978e), same result.
UPD: worth mentioning that
clang++
itself processes this file correctly, without segfaults.