Gakaza/googletest

EXPECT_EQ(kFalseConstant, ...) issues warning with GCC 4.7 and higher

Opened this issue · 1 comments

For example if we have:
const bool kFalseConstant = false;
EXPECT_EQ(kFalseConstant, foo());

GCC 4.7 will issue the following warning:
converting 'false' to pointer type for argument 1 of 'char 
testing::internal::IsNullLiteralHelper(testing::internal::Secret*)'

We are using the following workaround in Chromium:
EXPECT_TRUE(kFalseConstant == foo());

Though I'm not sure if it the expected behavior to consider kFalseConstant as 
compatible to null pointer. (why EXPECT_EQ has to check that anyway?) It may be 
a bug or not.

Original issue reported on code.google.com by trc...@chromium.org on 16 May 2014 at 11:38

Is it a duplication of https://code.google.com/p/googletest/issues/detail?id=322

Original comment by marc...@gmail.com on 17 Jul 2015 at 9:13