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
..
2018-08-13 22:45:53 -04:00
2018-12-03 12:54:11 -05:00
2018-08-20 14:50:48 -04:00
2019-03-05 08:39:34 -05:00
2019-02-25 17:20:00 -05:00
2019-03-01 16:18:24 -05:00
2019-01-03 16:40:20 -05:00
2019-01-03 16:40:20 -05:00