Hi,
This test fails to compile on Visual Studio 2010 with the error:
[snip] 10.0\VC\include\tuple(127): error C2440: 'initializing' :
cannot convert from 'int' to 'void *'
[snip] 10.0\VC\include\tuple(127): error C2439:
'std::tr1::_Cons_node<_Car,_Cdr>::_Value' : member could not be
initialized
The problem seems to be some complicated template thing interacting
with the nullptr changes in C++11. A similar problem is described
here:
https://connect.microsoft.com/VisualStudio/feedback/details/520043/error-converting-from-null-to-a-pointer-type-in-std-pair
The fix is to add an explicit cast to (void*):
$ svn diff
Index: test/gtest-printers_test.cc
===================================================================
--- test/gtest-printers_test.cc (revision 602)
+++ test/gtest-printers_test.cc (working copy)
@@ -1004,7 +1004,7 @@
const char* const str = "8";
tuple<bool, char, short, testing::internal::Int32, // NOLINT
testing::internal::Int64, float, double, const char*, void*,
string>
- t10(false, 'a', 3, 4, 5, 1.5F, -2.5, str, NULL, "10");
+ t10(false, 'a', 3, 4, 5, 1.5F, -2.5, str,
static_cast<void*>(NULL), "10");
EXPECT_EQ("(false, 'a' (97, 0x61), 3, 4, 5, 1.5, -2.5, " +
PrintPointer(str) +
" pointing to \"8\", NULL, \"10\")",
Print(t10));
I, Douglas Greiman, release this diff to the public domain permanently
and irrevocably, etc.