Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions include/boost/unordered/detail/implementation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <boost/unordered/detail/unordered_printers.hpp>

#include <boost/assert.hpp>
#include <boost/config/workaround.hpp>
#include <boost/core/allocator_traits.hpp>
#include <boost/core/bit.hpp>
#include <boost/core/invoke_swap.hpp>
Expand Down Expand Up @@ -954,10 +955,14 @@ namespace boost {

inline std::size_t double_to_size(double f)
{
return f >= static_cast<double>(
(std::numeric_limits<std::size_t>::max)())
? (std::numeric_limits<std::size_t>::max)()
: static_cast<std::size_t>(f);
#if BOOST_WORKAROUND(BOOST_CLANG_VERSION, < 30900)
// https://github.com/boostorg/unordered/pull/354
volatile
#endif
const double double_size_t_max =
static_cast<double>((std::numeric_limits<std::size_t>::max)());
return f >= double_size_t_max?
(std::numeric_limits<std::size_t>::max)(): static_cast<std::size_t>(f);
}

//////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions test/unordered/rehash_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -836,8 +836,8 @@ namespace rehash_tests {
(test_multiset_ptr)(int_multimap_ptr)
(test_multiset_tracking)(test_multimap_tracking))(
(default_generator)(generate_collisions)(limited_range)))
UNORDERED_TEST(test_gh348_1,((0)))
UNORDERED_TEST(test_gh348_2,((0)))
UNORDERED_TEST(test_gh348_1, ((0)))
UNORDERED_TEST(test_gh348_2, ((0)))
// clang-format on
#endif
} // namespace rehash_tests
Expand Down
Loading