[clang] [clang][bytecode] Pass initializer along in `evaluateAsInitializer()` (PR #158056)
Shafik Yaghmour via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 16 11:06:21 PDT 2025
================
@@ -49,14 +49,15 @@ EvaluationResult EvalEmitter::interpretExpr(const Expr *E,
return std::move(this->EvalResult);
}
-EvaluationResult EvalEmitter::interpretDecl(const VarDecl *VD,
+EvaluationResult EvalEmitter::interpretDecl(const VarDecl *VD, const Expr *Init,
bool CheckFullyInitialized) {
this->CheckFullyInitialized = CheckFullyInitialized;
S.EvaluatingDecl = VD;
S.setEvalLocation(VD->getLocation());
EvalResult.setSource(VD);
- if (const Expr *Init = VD->getAnyInitializer()) {
+ // FIXME: I think Init is never null.
+ if (Init) {
----------------
shafik wrote:
You could add an assert and if it crashes, then this is incorrect, it does not prove it but it could show the negative and then you have a test case.
https://github.com/llvm/llvm-project/pull/158056
More information about the cfe-commits
mailing list