diff options
Diffstat (limited to 'llvm/utils/unittest/googletest/include/gtest/gtest-message.h')
-rw-r--r-- | llvm/utils/unittest/googletest/include/gtest/gtest-message.h | 43 |
1 files changed, 3 insertions, 40 deletions
diff --git a/llvm/utils/unittest/googletest/include/gtest/gtest-message.h b/llvm/utils/unittest/googletest/include/gtest/gtest-message.h index 47ed669a9b1..30cb5ed6993 100644 --- a/llvm/utils/unittest/googletest/include/gtest/gtest-message.h +++ b/llvm/utils/unittest/googletest/include/gtest/gtest-message.h @@ -49,36 +49,7 @@ #include <limits> #include "gtest/internal/gtest-port.h" - -#if !GTEST_NO_LLVM_RAW_OSTREAM -#include "llvm/Support/raw_os_ostream.h" - -// LLVM INTERNAL CHANGE: To allow operator<< to work with both -// std::ostreams and LLVM's raw_ostreams, we define a special -// std::ostream with an implicit conversion to raw_ostream& and stream -// to that. This causes the compiler to prefer std::ostream overloads -// but still find raw_ostream& overloads. -namespace llvm { -class convertible_fwd_ostream : public std::ostream { - raw_os_ostream ros_; - -public: - convertible_fwd_ostream(std::ostream& os) - : std::ostream(os.rdbuf()), ros_(*this) {} - operator raw_ostream&() { return ros_; } -}; -} -template <typename T> -inline void GTestStreamToHelper(std::ostream& os, const T& val) { - llvm::convertible_fwd_ostream cos(os); - cos << val; -} -#else -template <typename T> -inline void GTestStreamToHelper(std::ostream& os, const T& val) { - os << val; -} -#endif +#include "gtest/internal/custom/raw-ostream.h" // Ensures that there is at least one operator<< in the global namespace. // See Message& operator<<(...) below for why. @@ -157,12 +128,8 @@ class GTEST_API_ Message { // from the global namespace. With this using declaration, // overloads of << defined in the global namespace and those // visible via Koenig lookup are both exposed in this function. -#if GTEST_NO_LLVM_RAW_OSTREAM using ::operator <<; - *ss_ << val; -#else - ::GTestStreamToHelper(*ss_, val); -#endif + *ss_ << llvm_gtest::printable(val); return *this; } @@ -184,11 +151,7 @@ class GTEST_API_ Message { if (pointer == NULL) { *ss_ << "(null)"; } else { -#if GTEST_NO_LLVM_RAW_OSTREAM - *ss_ << pointer; -#else - ::GTestStreamToHelper(*ss_, pointer); -#endif + *ss_ << llvm_gtest::printable(pointer); } return *this; } |