diff options
author | Abseil Team <absl-team@google.com> | 2019-05-23T17·13-0700 |
---|---|---|
committer | Derek Mauro <dmauro@google.com> | 2019-05-23T20·15-0400 |
commit | 4adaf5490921f13028b55018c9f550277de5aebb (patch) | |
tree | 7cf9e05843d368730fd460a038117a93d64f49ed | |
parent | 27c30ec671cb7b5ba84c4e79feff7fd0b0ac6338 (diff) |
Export of internal Abseil changes.
-- 2d7c9650fe2b1bf76085a993285e49db4d24aa4f by Derek Mauro <dmauro@google.com>: Fix a build error in hash_test.cc under MSVC 2017 PiperOrigin-RevId: 249666534 -- 66887d4ed411663f688fc9852701d648fe7cefe6 by Derek Mauro <dmauro@google.com>: Merge GitHub #316 - Avoid undefined behavior when passing nullptr to memcpy with size 0. Fixes #315 PiperOrigin-RevId: 249570899 GitOrigin-RevId: 2d7c9650fe2b1bf76085a993285e49db4d24aa4f Change-Id: I0fae0c581f3c0df9e6f70c69661973d020155738
-rw-r--r-- | absl/hash/hash_test.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/absl/hash/hash_test.cc b/absl/hash/hash_test.cc index 449e77b4e1a1..bab560bd4e64 100644 --- a/absl/hash/hash_test.cc +++ b/absl/hash/hash_test.cc @@ -524,6 +524,7 @@ struct MinTag<a> : InvokeTagConstant<a> {}; template <InvokeTag... Tags> struct CustomHashType { + explicit CustomHashType(size_t val) : value(val) {} size_t value; }; @@ -590,7 +591,7 @@ void TestCustomHashType(InvokeTagConstant<InvokeTag::kNone>, T...) { EXPECT_TRUE(is_hashable<const type&>()); const size_t offset = static_cast<int>(std::min({T::value...})); - EXPECT_EQ(SpyHash(type{7}), SpyHash(size_t{7 + offset})); + EXPECT_EQ(SpyHash(type(7)), SpyHash(size_t{7 + offset})); } void TestCustomHashType(InvokeTagConstant<InvokeTag::kNone>) { |