googletest/googletest/include/gtest/internal
Abseil Team 3dd2e841c3 Googletest export
Fix emission of -Wzero-as-null-pointer-constant when comparing integers.

The following code fails to compile:

#pragma clang diagnostic error "-Wzero-as-null-pointer-constant"
void foo() {
  EXPECT_EQ(0, 0);
}

This happens because gtest checks the first argument to EXPECT_EQ and
ASSERT_EQ is a null pointer constant. The magic it does to do this causes the
warning to be emitted.

This patch removes that check. It replaces the explicit check with a Compare
overload that can only be selected when 0 or nullptr is passed on the LHS
with a pointer on the right.

This patch does not suppress -Wzero-as-null-pointer-constant when users
are actually using it as NULL.

PiperOrigin-RevId: 236654634
2019-03-05 08:39:34 -05:00
..
custom formatting custom/README.md 2018-08-13 22:45:53 -04:00
gtest-death-test-internal.h Googletest export 2018-12-03 12:54:11 -05:00
gtest-filepath.h googletest export 2018-08-20 14:50:48 -04:00
gtest-internal.h Googletest export 2019-03-05 08:39:34 -05:00
gtest-param-util.h Googletest export 2019-02-25 17:20:00 -05:00
gtest-port-arch.h Import patch-bsd-defines from FreeBSD ports [1] 2019-02-12 22:43:07 -08:00
gtest-port.h Googletest export 2019-03-01 16:18:24 -05:00
gtest-string.h Comments changes, no functionality changes 2018-08-14 14:04:07 -04:00
gtest-type-util.h Googletest export 2019-01-03 16:40:20 -05:00
gtest-type-util.h.pump Googletest export 2019-01-03 16:40:20 -05:00