mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-17 17:20:38 +00:00
Instead of injecting code to declare an `operator new`, generate AST for it directly. In order to use this, directly generate a `CXXNewExpr` rather than asking Clang to build one. This is less of a hack, and doesn't visibly leak an `operator new` declaration that inline C++ code or template instantiations might see. It also avoids generating a warning in C++26 and later that the `constexpr` declaration of `operator new` is used but not defined. Assisted-by: Gemini 3.1 Pro via Antigravity