-
Notifications
You must be signed in to change notification settings - Fork 203
Build break in gmock and gmock_test projects (Windows) #188
Comments
I have got the same error mentioned in the 2nd point by chrsmith above while compiling googlemock release 1.7.0 version on Visual Studio 2015. Any one has a solution for this? Any help is greatly appreciated !! Error C2440 'return': cannot convert from 'testing::internal::EqMatchertesting::gmock_matchers_test::ConvertibleFromAny' to 'testing::Matchertesting::gmock_matchers_test::ConvertibleFromAny' gmock_test Both gmock and gmcok_main projects compile successfully on VS 2015 after a minor change in gmock_config.props. The error occurs when we compile gmock_test on VS 2015. |
got the same problem, any solution? |
I tried debugging this a bit. I think it's because somehow the compiler finds another path from 'const testing::internal::EqMatchertesting::gmock_matchers_test::ConvertibleFromAny' to 'testing::Matchertesting::gmock_matchers_test::ConvertibleFromAny' Looking at the code it should have implicitly called 'template EqMatcher::operator Matcher() const', inherited from ComparisonBase class. I'm not sure what other things that the compiler sees that makes it ambiguous? Matcher can implicitly be constructed from T (T is ConvertibleFromAny in this case). But there's nothing that can implicitly go from 'const EqMatcher' to 'ConvertibleFromAny'. Besides, there's that interesting comment right above the line with error: I'm stumped. This could be a compiler bug. Hopefully the above could help investigate this issue further. |
I got the same problem when I tried to guild the gmock test in the VS2015 IDE. |
I fixed this error by making the template constructor in ConvertibleFromAny explicit: explicit ConvertibleFromAny(const T& /a_value/) : value(-1) { After that I got an error here: TEST(EqTest, CanDescribeSelf) { In order to fix it, I made the member "operator==" in class Unprintable a non-member function:
Now I can build gmock_test with no errors and all the tests are passed when I run it. |
This was an error reported by someone on the old Google Code project. I'm reporting it here so that it doesn't get forgotten in the Google Code turndown.
Today I downloaded the most recent code from GitHub and I am still running into the same build issues.
If possible please fix the first one and publish. Secondly I really need your help on the second one.
The text was updated successfully, but these errors were encountered: