[libcxx-commits] [libcxx] 6c83565 - [libc++][ASan] Fix std::basic_string trait type (#91590)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu May 9 09:40:18 PDT 2024


Author: Tacet
Date: 2024-05-09T18:40:15+02:00
New Revision: 6c8356579b20a6522d39649bcaaaf77e8e324daf

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

LOG: [libc++][ASan] Fix std::basic_string trait type (#91590)

Addresses the comment:
https://github.com/llvm/llvm-project/pull/79536#discussion_r1593652240

Changes the type to `void` instead of `false_type`.

The value is used here:


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

Added: 
    

Modified: 
    libcxx/include/string

Removed: 
    


################################################################################
diff  --git a/libcxx/include/string b/libcxx/include/string
index 8f629d8bf13c..1db803e822d7 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,


        


More information about the libcxx-commits mailing list