From 5a5f3c116d17e94f6dbed428d06cee965ca7286d Mon Sep 17 00:00:00 2001 From: o-micron Date: Mon, 9 Mar 2020 21:01:14 +0200 Subject: [PATCH] possible fix --- googletest/include/gtest/gtest-matchers.h | 8 ++++++++ googletest/include/gtest/internal/gtest-port.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/googletest/include/gtest/gtest-matchers.h b/googletest/include/gtest/gtest-matchers.h index a61cef40..e34589c4 100644 --- a/googletest/include/gtest/gtest-matchers.h +++ b/googletest/include/gtest/gtest-matchers.h @@ -432,6 +432,14 @@ class GTEST_API_ Matcher #endif // GTEST_INTERNAL_HAS_STRING_VIEW // Prints a matcher in a human-readable format. +#if GTEST_INTERNAL_HAS_STRING_VIEW +template +std::ostream& operator<<(std::ostream& os, const Matcher& matcher) { + matcher.DescribeTo(&os); + return os; +} +#endif // GTEST_INTERNAL_HAS_STRING_VIEW + template std::ostream& operator<<(std::ostream& os, const Matcher& matcher) { matcher.DescribeTo(&os); diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h index 1299e705..60ff4716 100644 --- a/googletest/include/gtest/internal/gtest-port.h +++ b/googletest/include/gtest/internal/gtest-port.h @@ -2223,7 +2223,7 @@ const char* StringFromGTestEnv(const char* flag, const char* default_val); #endif // !defined(GTEST_INTERNAL_DEPRECATED) -#if GTEST_HAS_ABSL && __cplusplus >= 201703L // double check for c++17 support ? +#if GTEST_HAS_ABSL // Always use absl::string_view for Matcher<> specializations if googletest // is built with absl support. # define GTEST_INTERNAL_HAS_STRING_VIEW 1