Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
martinus committed Dec 14, 2023
1 parent 250ec0f commit 4611c37
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 2 additions & 0 deletions include/ankerl/unordered_dense.h
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,9 @@ class table : public std::conditional_t<is_map_v<T>, base_table_type_map<T>, bas

// assumes m_values has data, m_buckets=m_buckets_end=nullptr, m_shifts is INITIAL_SHIFTS
void copy_buckets(table const& other) {
// assumes m_values has already the correct data copied over.
if (empty()) {
// when empty, at least allocate an initial buckets and clear them.
allocate_buckets_from_shift();
clear_buckets();
} else {
Expand Down
10 changes: 7 additions & 3 deletions test/bench/game_of_life.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@
#include <vector>

#if __has_include("boost/unordered/unordered_flat_map.hpp")
# pragma clang diagnostic ignored "-Wold-style-cast"
# if defined(__clang__)
# pragma clang diagnostic ignored "-Wold-style-cast"
# endif
# include "boost/unordered/unordered_flat_map.hpp"
# define HAS_BOOST_UNORDERED_FLAT_MAP() 1 // NOLINT(cppcoreguidelines-macro-usage)
#else
# define HAS_BOOST_UNORDERED_FLAT_MAP() 0 // NOLINT(cppcoreguidelines-macro-usage)
#endif

#if 0 && __has_include("absl/container/flat_hash_map.h")
# pragma clang diagnostic ignored "-Wdeprecated-builtins"
# pragma clang diagnostic ignored "-Wsign-conversion"
# if defined(__clang__)
# pragma clang diagnostic ignored "-Wdeprecated-builtins"
# pragma clang diagnostic ignored "-Wsign-conversion"
# endif
# include <absl/container/flat_hash_map.h>
# define HAS_ABSL() 1 // NOLINT(cppcoreguidelines-macro-usage)
#else
Expand Down
6 changes: 4 additions & 2 deletions test/bench/show_allocations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
#include <third-party/nanobench.h>

#if __has_include("boost/unordered/unordered_flat_map.hpp")
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wold-style-cast"
# if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wold-style-cast"
# endif
# include "boost/unordered/unordered_flat_map.hpp"
# define HAS_BOOST_UNORDERED_FLAT_MAP() 1 // NOLINT(cppcoreguidelines-macro-usage)
#else
Expand Down
1 change: 1 addition & 0 deletions test/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ foreach arg : [
'-Wno-stringop-overflow', # g++ error in fmtlib
'-Warith-conversion',
'-Wshadow=global',
'-Wno-array-bounds', # gcc 13 gives incorrect warning

# gcc / clang
'-Wconversion',
Expand Down

0 comments on commit 4611c37

Please sign in to comment.