From 4adaf5490921f13028b55018c9f550277de5aebb Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Thu, 23 May 2019 10:13:53 -0700 Subject: Export of internal Abseil changes. -- 2d7c9650fe2b1bf76085a993285e49db4d24aa4f by Derek Mauro : Fix a build error in hash_test.cc under MSVC 2017 PiperOrigin-RevId: 249666534 -- 66887d4ed411663f688fc9852701d648fe7cefe6 by Derek Mauro : 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 --- absl/hash/hash_test.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'absl/hash') diff --git a/absl/hash/hash_test.cc b/absl/hash/hash_test.cc index 449e77b4..bab560bd 100644 --- a/absl/hash/hash_test.cc +++ b/absl/hash/hash_test.cc @@ -524,6 +524,7 @@ struct MinTag : InvokeTagConstant {}; template struct CustomHashType { + explicit CustomHashType(size_t val) : value(val) {} size_t value; }; @@ -590,7 +591,7 @@ void TestCustomHashType(InvokeTagConstant, T...) { EXPECT_TRUE(is_hashable()); const size_t offset = static_cast(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) { -- cgit v1.2.3