================ @@ -2434,6 +2434,22 @@ VarDecl *VarDecl::getInitializingDeclaration() { return Def; } +bool VarDecl::hasInitWithSideEffects() const { + if (!hasInit()) + return false; + + if (auto *S = dyn_cast<Stmt *>(Init)) { ---------------- benlangmuir wrote:
The original code in `getInit` also handles `EvaluatedStmt`. I would have naively expected we would call `getEvaluatedStmt()` and if present, we would check if it's an offset (in which case fall through to asking the `ASTReader::hasInitializerWithSideEffects`) or a pointer, in which case handle it here. But I'm not that familiar with `EvaluatedStmt` so maybe I missed something https://github.com/llvm/llvm-project/pull/143739 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits