summaryrefslogtreecommitdiffstats
path: root/googletest
diff options
context:
space:
mode:
authorGennadiy Civil <gennadiycivil@users.noreply.github.com>2018-06-04 16:00:20 (GMT)
committerGitHub <noreply@github.com>2018-06-04 16:00:20 (GMT)
commit2d136e5ec4a6657e5a1ae116f8752a48b68d5f40 (patch)
tree60a2efb5b8b1d4356da99474a8aa7c1f132c423c /googletest
parent7b08984da0cdee2156e45453a540030fae28156f (diff)
parent7e7f9d5fbffaa62c325d3c8c6c7431e95ba89ca9 (diff)
downloadgoogletest-2d136e5ec4a6657e5a1ae116f8752a48b68d5f40.zip
googletest-2d136e5ec4a6657e5a1ae116f8752a48b68d5f40.tar.gz
googletest-2d136e5ec4a6657e5a1ae116f8752a48b68d5f40.tar.bz2
Merge branch 'master' into fuchsia-launchpad-removalrefs/pull/1619/head
Diffstat (limited to 'googletest')
-rw-r--r--googletest/include/gtest/gtest-printers.h4
-rw-r--r--googletest/test/gtest-printers_test.cc6
2 files changed, 10 insertions, 0 deletions
diff --git a/googletest/include/gtest/gtest-printers.h b/googletest/include/gtest/gtest-printers.h
index e53963b..373946b 100644
--- a/googletest/include/gtest/gtest-printers.h
+++ b/googletest/include/gtest/gtest-printers.h
@@ -636,6 +636,10 @@ inline void PrintTo(absl::string_view sp, ::std::ostream* os) {
}
#endif // GTEST_HAS_ABSL
+#if GTEST_LANG_CXX11
+inline void PrintTo(std::nullptr_t, ::std::ostream* os) { *os << "(nullptr)"; }
+#endif // GTEST_LANG_CXX11
+
#if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
// Helper function for printing a tuple. T must be instantiated with
// a tuple type.
diff --git a/googletest/test/gtest-printers_test.cc b/googletest/test/gtest-printers_test.cc
index a373851..49b3bd4 100644
--- a/googletest/test/gtest-printers_test.cc
+++ b/googletest/test/gtest-printers_test.cc
@@ -1115,6 +1115,12 @@ TEST(PrintStdTupleTest, NestedTuple) {
#endif // GTEST_LANG_CXX11
+#if GTEST_LANG_CXX11
+TEST(PrintNullptrT, Basic) {
+ EXPECT_EQ("(nullptr)", Print(nullptr));
+}
+#endif // GTEST_LANG_CXX11
+
// Tests printing user-defined unprintable types.
// Unprintable types in the global namespace.