[clang] b75c1d1 - [clang][bytecode] Disable preservenone attribute on clang19+asan (#189377)

via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 30 07:19:51 PDT 2026


Author: Timm Baeder
Date: 2026-03-30T16:19:45+02:00
New Revision: b75c1d1163e237b1f671bd259d9c693936c548ca

URL: https://github.com/llvm/llvm-project/commit/b75c1d1163e237b1f671bd259d9c693936c548ca
DIFF: https://github.com/llvm/llvm-project/commit/b75c1d1163e237b1f671bd259d9c693936c548ca.diff

LOG: [clang][bytecode] Disable preservenone attribute on clang19+asan (#189377)

This better not break anything else.

Added: 
    

Modified: 
    clang/lib/AST/ByteCode/Interp.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ByteCode/Interp.h b/clang/lib/AST/ByteCode/Interp.h
index 3578ef9da820b..2af697cfed389 100644
--- a/clang/lib/AST/ByteCode/Interp.h
+++ b/clang/lib/AST/ByteCode/Interp.h
@@ -38,7 +38,10 @@
 
 // preserve_none is supported on aarch64, but causes problems when asan is
 // enabled. See https://github.com/llvm/llvm-project/issues/177519.
+// preserve_none also causes problems on clang <= 19 if asan is enabled.
 #if !defined(__aarch64__) && !defined(__i386__) &&                             \
+    !(defined(__clang_major__) && __clang_major__ <= 19 &&                     \
+      __has_feature(address_sanitizer)) &&                                     \
     __has_cpp_attribute(clang::preserve_none)
 #define PRESERVE_NONE [[clang::preserve_none]]
 #else


        


More information about the cfe-commits mailing list