-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix operator== overload ambiguity #1067
Conversation
Is there a way to add a test for the change? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to add a test case for the change?
I've been thinking about how best to approach this; a basic equality comparison with |
@th0br0 Do you have an idea how to proceed with this PR? |
Any news on this? |
@th0br0 Any idea how to proceed here? |
@th0br0 As for a test case: couldn't you just see which call Google Mock made when you detected the error and use it as regression test for your fix? |
I just stumbled on this issue, and it looks very similar to what I've described in #960. Here, the compiler considers converting an internal GMock type to
Since ADL looks at the template arguments too, so you have the same issue. I've explained in detail why it happens in #960. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Currently,
json
does not work well together with GoogleMock.(e.g.
MOCK_METHOD0(sample, nlohmann::json(void));
)This is because of an ambiguous overload which this PR fixes by disabling one of the two.
As
std::is_null_pointer
is only available from C++14, this uses the possible implementation from http://en.cppreference.com/w/cpp/types/is_null_pointerExample error: