From aa97e29920582ad9150c0fc04693a5bf2b57d28c Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 12 Oct 2016 14:14:04 +0200 Subject: [PATCH] Clang: Add ostream for clang::StringRef Change-Id: Ibafb1c179fcc49f1df330537ad6dc9addba5618d Reviewed-by: Tim Jenssen --- tests/unit/unittest/gtest-qt-printing.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/unit/unittest/gtest-qt-printing.h b/tests/unit/unittest/gtest-qt-printing.h index 54c79569aeb..12238e90828 100644 --- a/tests/unit/unittest/gtest-qt-printing.h +++ b/tests/unit/unittest/gtest-qt-printing.h @@ -69,6 +69,14 @@ QT_END_NAMESPACE #ifdef CLANG_UNIT_TESTS namespace clang { +inline +std::ostream &operator<<(std::ostream &out, const StringRef stringReference) +{ + out.write(stringReference.data(), std::streamsize(stringReference.size())); + + return out; +} + inline void PrintTo(const clang::FullSourceLoc &sourceLocation, ::std::ostream *os) { auto &&sourceManager = sourceLocation.getManager();