[libcxx-commits] [libcxx] r374806 - [libc++][test] Portability fix for std::any tests

Casey Carter via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 14 12:05:04 PDT 2019


Author: caseycarter
Date: Mon Oct 14 12:05:04 2019
New Revision: 374806

URL: http://llvm.org/viewvc/llvm-project?rev=374806&view=rev
Log:
[libc++][test] Portability fix for std::any tests

Ensure that `large_tracked_t` defined in `any_helpers.h` is in fact too large to fit in `std::any`'s small object buffer.

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=374806&r1=374805&r2=374806&view=diff
==============================================================================
--- libcxx/trunk/test/support/any_helpers.h (original)
+++ libcxx/trunk/test/support/any_helpers.h Mon Oct 14 12:05:04 2019
@@ -414,10 +414,10 @@ struct large_tracked_t {
       : arg_types(&makeArgumentID<std::initializer_list<int>, Args...>()) {}
 
   TypeID const* arg_types;
-  int dummy[10];
+  int dummy[sizeof(std::any) / sizeof(int) + 1];
 };
 
-static_assert(!IsSmallObject<large_tracked_t>::value, "must be small");
+static_assert(!IsSmallObject<large_tracked_t>::value, "must not be small");
 
 
 template <class Type, class ...Args>




More information about the libcxx-commits mailing list