[clang] [LifetimeSafety] Diagnose UAF for aligned and nothrow new expressions (PR #202286)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 8 08:11:13 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;
----------------
NeKon69 wrote:

What's the point in declaring it `extern` if you do not redefine it later in the source? Is there a reason why just `const nothrow_t nothrow;` won't work? That's a pretty minor change though, just curious.

https://github.com/llvm/llvm-project/pull/202286


More information about the cfe-commits mailing list