[llvm-branch-commits] [libcxx] Prepare libcxx and libcxxabi for pointer field protection. (PR #151651)

Louis Dionne via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Dec 4 13:26:20 PST 2025


================
@@ -1067,6 +1067,12 @@ typedef __char32_t char32_t;
 #    define _LIBCPP_DIAGNOSE_NULLPTR
 #  endif
 
+#  if __has_cpp_attribute(_Clang::__no_field_protection__)
+#    define _LIBCPP_NO_PFP [[_Clang::__no_field_protection__]]
+#  else
+#    define _LIBCPP_NO_PFP
+#  endif
----------------
ldionne wrote:

I'd suggest `_LIBCPP_DISABLE_PFP` or even `_LIBCPP_DISABLE_POINTER_FIELD_PROTECTION`. `_LIBCPP_NO_PFP` feels like like a yes-no macro, not an attribute macro.

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


More information about the llvm-branch-commits mailing list