[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
Wed Mar 25 06:47:02 PDT 2026


================
@@ -34,10 +34,13 @@ template <class _Tp, class = void>
 struct __libcpp_is_trivially_relocatable : is_trivially_copyable<_Tp> {};
 #endif
 
+// __trivially_relocatable on libc++'s builtin types does not currently return the right answer with PFP.
----------------
ldionne wrote:

Coming back to this, wouldn't it be sufficient to say that when PFP is enabled, `__libcpp_is_trivially_relocatable<_Tp*>` is false via a partial specialization?

I think a few types like `locale` would then have to be adjusted to be conditional on whether e.g. `__imp*` is TR, but I think that should be relatively small. Most other classes which are templates should already handle this correctly by determining their TR-ness conditionally on their members. WDYT?

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


More information about the llvm-branch-commits mailing list