[compiler-rt] [asan] Enable exceptions for asan_new_delete.cpp translation unit (PR #200719)

Justin T. Gibbs via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 1 10:53:36 PDT 2026


================
@@ -143,6 +143,20 @@ set(ASAN_DYNAMIC_CFLAGS ${ASAN_CFLAGS})
 append_list_if(COMPILER_RT_HAS_FTLS_MODEL_INITIAL_EXEC
   -ftls-model=initial-exec ASAN_DYNAMIC_CFLAGS)
 
+# asan_new_delete.cpp throws std::bad_alloc, so the translation units that
+# build it need -fexceptions and access to <new> (drop -nostdinc++). Only
+# the C++ slices (RTAsan_cxx in the static build and RTAsan_dynamic_cxx in
+# the dynamic build) opt into these flags — the rest of the runtime keeps
+# -fno-exceptions / -nostdinc++. RTTI stays disabled; libstdc++ / libc++abi
+# supply the bad_alloc typeinfo.
----------------
scsiguy wrote:

Done.

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


More information about the llvm-commits mailing list