diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-01-25 20:04:44 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-01-25 20:04:44 +0000 |
commit | 8a8454bc31c91fbb6966416ca2fa6924fdfaf598 (patch) | |
tree | a0b0f57d4a2f1d7a2e51641db4cf9e419d27e739 /clang/unittests/AST/DeclPrinterTest.cpp | |
parent | b8d499fe2ff637bf743647aadaa1016f0e5d4dde (diff) | |
download | bcm5719-llvm-8a8454bc31c91fbb6966416ca2fa6924fdfaf598.tar.gz bcm5719-llvm-8a8454bc31c91fbb6966416ca2fa6924fdfaf598.zip |
unittests: explicit stringify StringRefs for conversion
When clang is built outside of the LLVM tree (against a corresponding version),
there is no definition providing for operator<<(std::ostream &, StringRef) which
is required for the assertion routines in google-test tests. Avoid the
compilation failure by explicitly stringifying the StringRef prior to use.
llvm-svn: 200096
Diffstat (limited to 'clang/unittests/AST/DeclPrinterTest.cpp')
-rw-r--r-- | clang/unittests/AST/DeclPrinterTest.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/unittests/AST/DeclPrinterTest.cpp b/clang/unittests/AST/DeclPrinterTest.cpp index ade55aaee36..66da3866029 100644 --- a/clang/unittests/AST/DeclPrinterTest.cpp +++ b/clang/unittests/AST/DeclPrinterTest.cpp @@ -77,7 +77,8 @@ public: OwningPtr<FrontendActionFactory> Factory(newFrontendActionFactory(&Finder)); if (!runToolOnCodeWithArgs(Factory->create(), Code, Args, FileName)) - return testing::AssertionFailure() << "Parsing error in \"" << Code << "\""; + return testing::AssertionFailure() + << "Parsing error in \"" << Code.str() << "\""; if (Printer.getNumFoundDecls() == 0) return testing::AssertionFailure() @@ -90,8 +91,8 @@ public: if (Printer.getPrinted() != ExpectedPrinted) return ::testing::AssertionFailure() - << "Expected \"" << ExpectedPrinted << "\", " - "got \"" << Printer.getPrinted() << "\""; + << "Expected \"" << ExpectedPrinted.str() << "\", " + "got \"" << Printer.getPrinted().str() << "\""; return ::testing::AssertionSuccess(); } |