Skip to content

Conversation

AdvenamTacet
Copy link
Member

@AdvenamTacet AdvenamTacet commented May 9, 2024

Addresses the comment: #79536 (comment)

Changes the type to void instead of false_type.

The value is used here:

template <class _Tp>
struct __libcpp_is_trivially_relocatable<_Tp,
__enable_if_t<is_same<_Tp, typename _Tp::__trivially_relocatable>::value> >
: true_type {};

@AdvenamTacet AdvenamTacet requested a review from philnik777 May 9, 2024 13:23
@AdvenamTacet AdvenamTacet requested a review from a team as a code owner May 9, 2024 13:23
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label May 9, 2024
@llvmbot
Copy link
Member

llvmbot commented May 9, 2024

@llvm/pr-subscribers-libcxx

Author: Tacet (AdvenamTacet)

Changes

Addresses comment: #79536 (comment)

Changes type to void instead of false_type.

The value is used here:

https://github.com/llvm/llvm-project/blob/main/libcxx/include/__type_traits/is_trivially_relocatable.h#L35-L38


Full diff: https://github.com/llvm/llvm-project/pull/91590.diff

1 Files Affected:

  • (modified) libcxx/include/string (+2-2)
diff --git a/libcxx/include/string b/libcxx/include/string
index 8f629d8bf13c8..1db803e822d72 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -741,8 +741,8 @@ public:
   // is kept inside objects memory (short string optimization), instead of in allocated
   // external memory. In such cases, the destructor is responsible for unpoisoning
   // the memory to avoid triggering false positives.
-  // Therefore it's crucial to ensure the destructor is called
-  using __trivially_relocatable = false_type;
+  // Therefore it's crucial to ensure the destructor is called.
+  using __trivially_relocatable = void;
 #else
   using __trivially_relocatable = __conditional_t<
       __libcpp_is_trivially_relocatable<allocator_type>::value && __libcpp_is_trivially_relocatable<pointer>::value,

@AdvenamTacet AdvenamTacet merged commit 6c83565 into llvm:main May 9, 2024
@AdvenamTacet AdvenamTacet deleted the asan-traits-fix branch May 9, 2024 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants