[clang] Reland "[Modules] Record whether VarDecl initializers contain side effects" (PR #145447)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 4 11:04:51 PDT 2025
bgra8 wrote:
> Is it fixed by https://github.com/llvm/llvm-project/pull/146468?
I patched https://github.com/llvm/llvm-project/pull/146468 after this change, rebuilt the compiler and reproduced the same crash. So I guess that patch does not fix the issue I see here. Does https://github.com/llvm/llvm-project/pull/146468 depend on some other change?
The assertion looks similar:
```
assert.h assertion failed at llvm-project/llvm/include/llvm/Support/Casting.h:566 in decltype(auto) llvm::cast(const From &) [To = clang::RecordType, From = clang::QualType]: isa<To>(Val) && "cast<Ty>() argument of incompatible type!"
*** Check failure stack trace: ***
@ 0x564b4bf20f04 absl::log_internal::LogMessage::SendToLog()
@ 0x564b4bf20ec7 absl::log_internal::LogMessage::Flush()
@ 0x564b4c149204 __assert_fail
@ 0x564b48372ad0 CheckEvaluationResult()
@ 0x564b483353a5 clang::Expr::EvaluateAsInitializer()
@ 0x564b4824eb32 clang::VarDecl::evaluateValueImpl()
@ 0x564b4824e07a clang::VarDecl::evaluateValue()
@ 0x564b4824df78 clang::VarDecl::hasInitWithSideEffects()
@ 0x564b47395839 clang::ASTDeclWriter::VisitVarDecl()
@ 0x564b4738e996 clang::ASTDeclWriter::Visit()
@ 0x564b473a18bc clang::ASTWriter::WriteDecl()
@ 0x564b47351725 clang::ASTWriter::WriteDeclAndTypes()
@ 0x564b4734b42b clang::ASTWriter::WriteASTCore()
@ 0x564b4734a131 clang::ASTWriter::WriteAST()
@ 0x564b473bb1e0 clang::PCHGenerator::HandleTranslationUnit()
@ 0x564b46f27cfd clang::MultiplexConsumer::HandleTranslationUnit()
@ 0x564b4713a948 clang::ParseAST()
@ 0x564b46e6e34a clang::FrontendAction::Execute()
@ 0x564b46de125d clang::CompilerInstance::ExecuteAction()
@ 0x564b4622586b clang::ExecuteCompilerInvocation()
@ 0x564b46219218 cc1_main()
@ 0x564b46216334 ExecuteCC1Tool()
@ 0x564b46f97a3e llvm::function_ref<>::callback_fn<>()
@ 0x564b4bd95c9c llvm::CrashRecoveryContext::RunSafely()
@ 0x564b46f96f24 clang::driver::CC1Command::Execute()
@ 0x564b46f57615 clang::driver::Compilation::ExecuteCommand()
@ 0x564b46f578af clang::driver::Compilation::ExecuteJobs()
@ 0x564b46f73200 clang::driver::Driver::ExecuteCompilation()
@ 0x564b4621593d clang_main()
@ 0x564b46213cf4 main
@ 0x7f816c5b43d4 __libc_start_main
@ 0x564b46213c2a _start
```
https://github.com/llvm/llvm-project/pull/145447
More information about the cfe-commits
mailing list