Use std::addressof to instead of plain '&'.
Otherwise the code won't compile if the '&' operater is overloaded and
return something that cannot be casted to void *.
diff --git a/googletest/include/gtest/gtest-printers.h b/googletest/include/gtest/gtest-printers.h
index 97cdb2a..5a3ca82 100644
--- a/googletest/include/gtest/gtest-printers.h
+++ b/googletest/include/gtest/gtest-printers.h
@@ -152,8 +152,8 @@
// This default version is called when kTypeKind is kOtherType.
static void PrintValue(const T& value, ::std::ostream* os) {
PrintBytesInObjectTo(static_cast<const unsigned char*>(
- reinterpret_cast<const void*>(&value)),
- sizeof(value), os);
+ reinterpret_cast<const void*>(
+ std::addressof(value))), sizeof(value), os);
}
};