Closed GoogleCodeExporter closed 9 years ago
This is a GCC bug. gtest isn't trying to actually covert false to a pointer.
It just uses a Template Meta Programming trick that's blessed by the C++
standard to detect NULL literals.
Also, the canonical way to write your assertion is EXPECT_FALSE(...). That
will avoid the warning.
Original comment by w...@google.com
on 29 Oct 2010 at 4:56
Hi,
And what is the canonical way to rewrite:
EXPECT_EQ(DEBUG_MODE != 0, DLOG_IS_ON(INFO));
?
The problem prevents me compiling Chromium with gcc 4.5.2
TIA
Original comment by dvyu...@google.com
on 6 Apr 2011 at 6:42
Please send questions to the mailing list instead of here. Thanks.
Original comment by w...@google.com
on 6 Apr 2011 at 6:47
For the record, there is a really trivial fix (to gtest) for this issue... add
this additional overload:
char (&IsNullLiteralHelper(bool))[2];
Original comment by matthew....@kitware.com
on 12 Feb 2013 at 7:19
Original issue reported on code.google.com by
chen3feng
on 13 Oct 2010 at 1:57