[clang] [clang-repl] Typo within InterpreterTest.cpp (PR #79119)
Vassil Vassilev via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 24 11:30:07 PST 2024
================
@@ -256,7 +256,8 @@ static Value AllocateObject(TypeDecl *TD, Interpreter &Interp) {
// cantFail(Interp.ParseAndExecute("new " + Name + "()", &Addr));
// The lifetime of the temporary is extended by the clang::Value.
- cantFail(Interp.ParseAndExecute(Name + "()", &Addr));
+ cantFail(Interp.ParseAndExecute(Name + "();", &Addr));
+ Addr.setKind(Value::Kind::K_PtrOrObj);
----------------
vgvassilev wrote:
Could you explain why we need this? The missing semicolon on the previous line is on purpose. This tells the interpreter to store its result into the Value object.
https://github.com/llvm/llvm-project/pull/79119
More information about the cfe-commits
mailing list