diff options
Diffstat (limited to 'googletest/include/gtest/gtest.h')
-rw-r--r-- | googletest/include/gtest/gtest.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/googletest/include/gtest/gtest.h b/googletest/include/gtest/gtest.h index 960ee43..c19ee2b 100644 --- a/googletest/include/gtest/gtest.h +++ b/googletest/include/gtest/gtest.h @@ -1449,6 +1449,13 @@ AssertionResult CmpHelperEQFailure(const char* lhs_expression, false); } +// This block of code defines operator==/!= +// to block lexical scope lookup. +// It prevents using invalid operator==/!= defined at namespace scope. +struct faketype {}; +inline bool operator==(faketype, faketype) { return true; } +inline bool operator!=(faketype, faketype) { return false; } + // The helper function for {ASSERT|EXPECT}_EQ. template <typename T1, typename T2> AssertionResult CmpHelperEQ(const char* lhs_expression, |