Просмотр исходного кода

Fix libcxx build under cl /std:c++14 needed for CUDA

static_assert with one argument is added in `C++17`. The code in PR is used in `C++14` mode through CUDA build.

This is needed to build catboost on Windows using cl.exe as CUDA host compiler.
spreis 2 лет назад
Родитель
Сommit
fc5c4121cc
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      contrib/libs/cxxsupp/libcxx/include/vector

+ 1 - 1
contrib/libs/cxxsupp/libcxx/include/vector

@@ -3294,7 +3294,7 @@ struct _LIBCPP_TEMPLATE_VIS hash<vector<bool, _Allocator> >
         size_t __idx = 0;
         size_t __n = __vec.size();
         constexpr size_t __bits_per_word = sizeof(typename allocator_traits<_Allocator>::size_type) * CHAR_BIT;
-        static_assert(sizeof(typename allocator_traits<_Allocator>::size_type) <= sizeof(size_t));
+        static_assert(sizeof(typename allocator_traits<_Allocator>::size_type) <= sizeof(size_t), "size_type constraint violated");
         for (;__idx + __bits_per_word <= __n;) {
             for (size_t __bit = 0; __bit < __bits_per_word; __bit++, __idx++) {
                 __h ^= static_cast<size_t>(__vec[__idx]) << __bit;