[clang] [LifetimeSafety] Diagnose UAF for aligned and nothrow new expressions (PR #202286)
Zeyi Xu via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 8 08:21:56 PDT 2026
================
@@ -53,6 +53,9 @@ T *begin(T (&array)[N]);
using size_t = decltype(sizeof(0));
using nullptr_t = decltype(nullptr);
+enum class align_val_t : size_t {};
+struct nothrow_t {};
+extern const nothrow_t nothrow;
----------------
zeyi2 wrote:
There is no specific reason on this, I just copied it from https://cppreference.com/cpp/memory/new/nothrow
IMO this would better reflect how `nothrow_t` is implemented in real `std`.
https://github.com/llvm/llvm-project/pull/202286
More information about the cfe-commits
mailing list