Ver código fonte

[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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374806 91177308-0d34-0410-b5e6-96231b3b80d8
Casey Carter 5 anos atrás
pai
commit
5f31123bc7
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      test/support/any_helpers.h

+ 2 - 2
test/support/any_helpers.h

@@ -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>