[libcxx-commits] [libcxx] r374407 - [libc++][test] Change IsSmallObject's calculation for std::any's small object buffer

Casey Carter via libcxx-commits libcxx-commits at lists.llvm.org
Thu Oct 10 11:07:12 PDT 2019


Author: caseycarter
Date: Thu Oct 10 11:07:12 2019
New Revision: 374407

URL: http://llvm.org/viewvc/llvm-project?rev=374407&view=rev
Log:
[libc++][test] Change IsSmallObject's calculation for std::any's small object buffer

`sizeof(std::any) - sizeof(void*)` is correct for both libc++ and the MSVC standard library.

Differential Revision: https://reviews.llvm.org/D68756

Modified:
    libcxx/trunk/test/support/any_helpers.h

Modified: libcxx/trunk/test/support/any_helpers.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/any_helpers.h?rev=374407&r1=374406&r2=374407&view=diff
==============================================================================
--- libcxx/trunk/test/support/any_helpers.h (original)
+++ libcxx/trunk/test/support/any_helpers.h Thu Oct 10 11:07:12 2019
@@ -26,7 +26,7 @@ namespace std { namespace experimental {
 template <class T>
   struct IsSmallObject
     : public std::integral_constant<bool
-        , sizeof(T) <= (sizeof(void*)*3)
+        , sizeof(T) <= sizeof(std::any) - sizeof(void*)
           && std::alignment_of<void*>::value
              % std::alignment_of<T>::value == 0
           && std::is_nothrow_move_constructible<T>::value




More information about the libcxx-commits mailing list