[clang-repl] Add a interpreter-specific overload of operator new for C++ (#76218)
commit1566f1ffc6b52bee659071d460123c1c4a358d01
authorVassil Vassilev <v.g.vassilev@gmail.com>
Thu, 18 Jan 2024 14:06:04 +0000 (18 16:06 +0200)
committerGitHub <noreply@github.com>
Thu, 18 Jan 2024 14:06:04 +0000 (18 16:06 +0200)
treeefc4ab60b9841879dde13bf9d0d52adf3b4fc8d8
parente6a6a90fe739d5f792645bf237eb0e540fad8c69
[clang-repl] Add a interpreter-specific overload of operator new for C++ (#76218)

This patch brings back the basic support for C by inserting the required
for value printing runtime only when we are in C++ mode. Additionally,
it defines a new overload of operator placement new because we can't
really forward declare it in a library-agnostic way.

Fixes the issue described in llvm/llvm-project#69072.
clang/include/clang/Interpreter/Interpreter.h
clang/lib/Interpreter/Interpreter.cpp
clang/test/Interpreter/incremental-mode.cpp
clang/unittests/Interpreter/InterpreterTest.cpp