diff options
author | Abseil Team <absl-team@google.com> | 2019-03-04 11:10:22 -0500 |
---|---|---|
committer | Gennadiy Civil <misterg@google.com> | 2019-03-05 08:39:34 -0500 |
commit | 3dd2e841c34bfe3d966ae6606f9b69d75f1a3442 (patch) | |
tree | ee9b33c9a614572001283fb9f2ba68f1969b5fdc /googlemock/test/gmock-function-mocker_nc_test.py | |
parent | a1dd07786b9a780a10be9dd643096b28f5a266d2 (diff) | |
download | googletest-3dd2e841c34bfe3d966ae6606f9b69d75f1a3442.tar.gz googletest-3dd2e841c34bfe3d966ae6606f9b69d75f1a3442.tar.bz2 googletest-3dd2e841c34bfe3d966ae6606f9b69d75f1a3442.zip |
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
Diffstat (limited to 'googlemock/test/gmock-function-mocker_nc_test.py')
0 files changed, 0 insertions, 0 deletions