From 4bb49ed640e34e23187ad7ea689693ef9927033f Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Thu, 4 Oct 2018 18:28:05 -0400 Subject: Apply clang-tidy modernize-use-nullptr to googletest. Now that googletest has moved to C++11, it should no longer use NULL or 0 for the null pointer. This patch converts all such usages to nullptr using clang-tidy. This prevents LLVM from issuing -Wzero-as-null-pointer-constant warnings. PiperOrigin-RevId: 215814400 --- googletest/include/gtest/gtest-printers.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'googletest/include/gtest/gtest-printers.h') diff --git a/googletest/include/gtest/gtest-printers.h b/googletest/include/gtest/gtest-printers.h index 39c5c463..6703b303 100644 --- a/googletest/include/gtest/gtest-printers.h +++ b/googletest/include/gtest/gtest-printers.h @@ -449,7 +449,7 @@ void DefaultPrintTo(WrapPrinterType /* dummy */, template void DefaultPrintTo(WrapPrinterType /* dummy */, T* p, ::std::ostream* os) { - if (p == NULL) { + if (p == nullptr) { *os << "NULL"; } else { // T is not a function type. We just call << to print p, @@ -461,7 +461,7 @@ void DefaultPrintTo(WrapPrinterType /* dummy */, template void DefaultPrintTo(WrapPrinterType /* dummy */, T* p, ::std::ostream* os) { - if (p == NULL) { + if (p == nullptr) { *os << "NULL"; } else { // T is a function type, so '*os << p' doesn't do what we want @@ -914,7 +914,7 @@ template <> class UniversalTersePrinter { public: static void Print(const char* str, ::std::ostream* os) { - if (str == NULL) { + if (str == nullptr) { *os << "NULL"; } else { UniversalPrint(std::string(str), os); @@ -934,7 +934,7 @@ template <> class UniversalTersePrinter { public: static void Print(const wchar_t* str, ::std::ostream* os) { - if (str == NULL) { + if (str == nullptr) { *os << "NULL"; } else { UniversalPrint(::std::wstring(str), os); -- cgit v1.2.1