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-12-17 13:53:46 -05:00
2018-09-14 19:40:51 -04:00
2019-01-02 16:51:40 -05:00
2019-01-11 13:59:22 -05:00
2019-01-02 16:51:40 -05:00
2019-01-11 13:59:22 -05:00
2019-01-02 16:51:40 -05:00
2019-01-11 13:59:22 -05:00
2019-01-14 17:01:56 -05:00
2018-12-03 12:54:11 -05:00
2019-01-11 13:59:22 -05:00
2019-01-02 16:51:40 -05:00
2018-10-29 13:46:16 -04:00
2018-12-03 12:54:11 -05:00
2018-03-05 14:21:41 -05:00
2019-01-03 16:40:27 -05:00
2019-01-11 13:59:22 -05:00
2018-10-24 11:26:16 -04:00
2018-10-30 21:20:43 -04:00
2019-01-02 16:51:40 -05:00
2019-03-05 08:39:34 -05:00
2018-12-03 12:54:11 -05:00
2018-12-03 12:54:11 -05:00
2019-01-02 16:51:40 -05:00
2019-01-11 13:59:22 -05:00
2018-09-14 19:40:51 -04:00
2019-01-11 13:59:22 -05:00
2019-01-11 13:59:22 -05:00
2019-01-11 13:59:22 -05:00
2019-01-11 13:59:22 -05:00