[clang] [Modules] fix assert in hasInitWithSideEffects (PR #146468)
Henrik G. Olsson via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 3 10:42:03 PDT 2025
hnrklssn wrote:
@ChuanqiXu9 After investigating the test failures for my previous fix I realised I'd misunderstood `EvaluatedStmt`. That fix caused test failures because it essentially ignored `EvaluatedStmt` initializers if they didn't originate in a deserialized AST and were known to have side effects. If the defining module had an `EvaluatedStmt` initializer it would say it didn't have side effects since there would be no `ASTReader` claiming to know about side effects for that `VarDecl`. I rewrote the approach completely to cache the result of `VarDecl::hasInitWithSideEffects` in `EvaluatedStmt`. Since all deserialized `VarDecl` initializers are `EvaluatedStmt` that works great.
https://github.com/llvm/llvm-project/pull/146468
More information about the cfe-commits
mailing list