From 80306a7b5ec8ddaabd26540f2827b903d69e7a02 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Thu, 21 Sep 2023 10:31:33 -0700 Subject: [PATCH] Use `absl::HasAbslStringify`, instead of the internal version. PiperOrigin-RevId: 567349341 Change-Id: I35f2679901aecbe9cb90d2e78ff28c5e383e7257 --- googletest/include/gtest/gtest-message.h | 19 +++++++++---------- googletest/include/gtest/gtest-printers.h | 9 ++++----- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/googletest/include/gtest/gtest-message.h b/googletest/include/gtest/gtest-message.h index 59b805e4..448ac6b7 100644 --- a/googletest/include/gtest/gtest-message.h +++ b/googletest/include/gtest/gtest-message.h @@ -59,7 +59,7 @@ #ifdef GTEST_HAS_ABSL #include -#include "absl/strings/internal/has_absl_stringify.h" +#include "absl/strings/has_absl_stringify.h" #include "absl/strings/str_cat.h" #endif // GTEST_HAS_ABSL @@ -121,14 +121,14 @@ class GTEST_API_ Message { // Streams a non-pointer value to this object. If building a version of // GoogleTest with ABSL, this overload is only enabled if the value does not // have an AbslStringify definition. - template ::value, // NOLINT - int>::type = 0 + , + typename std::enable_if::value, // NOLINT + int>::type = 0 #endif // GTEST_HAS_ABSL - > + > inline Message& operator<<(const T& val) { // Some libraries overload << for STL containers. These // overloads are defined in the global namespace instead of ::std. @@ -153,9 +153,8 @@ class GTEST_API_ Message { // Streams a non-pointer value with an AbslStringify definition to this // object. template ::value, // NOLINT - int>::type = 0> + typename std::enable_if::value, // NOLINT + int>::type = 0> inline Message& operator<<(const T& val) { // ::operator<< is needed here for a similar reason as with the non-Abseil // version above diff --git a/googletest/include/gtest/gtest-printers.h b/googletest/include/gtest/gtest-printers.h index 9ccbff7d..1b12ef68 100644 --- a/googletest/include/gtest/gtest-printers.h +++ b/googletest/include/gtest/gtest-printers.h @@ -116,7 +116,7 @@ #include #ifdef GTEST_HAS_ABSL -#include "absl/strings/internal/has_absl_stringify.h" +#include "absl/strings/has_absl_stringify.h" #include "absl/strings/str_cat.h" #endif // GTEST_HAS_ABSL #include "gtest/internal/gtest-internal.h" @@ -292,10 +292,9 @@ struct ConvertibleToStringViewPrinter { #ifdef GTEST_HAS_ABSL struct ConvertibleToAbslStringifyPrinter { - template < - typename T, - typename = typename std::enable_if< - absl::strings_internal::HasAbslStringify::value>::type> // NOLINT + template ::value>::type> // NOLINT static void PrintValue(const T& value, ::std::ostream* os) { *os << absl::StrCat(value); }