diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp index ee17a57e9fb4..a53090576068 100644 --- a/clang/lib/Analysis/CFRefCount.cpp +++ b/clang/lib/Analysis/CFRefCount.cpp @@ -30,7 +30,6 @@ #include "llvm/Support/Compiler.h" #include "llvm/ADT/STLExtras.h" #include -#include #include using namespace clang; @@ -2479,13 +2478,13 @@ CFRefReport::getEndPath(BugReporter& br, const ExplodedNode* EndN) { // Generate the diagnostic. FullSourceLoc L( S->getLocStart(), SMgr); - std::ostringstream os; + std::string sbuf; + llvm::raw_string_ostream os(sbuf); os << "Object allocated on line " << AllocLine; if (FirstBinding) os << " and stored into '" << FirstBinding->getString() << '\''; - // Get the retain count. const RefVal* RV = EndN->getState()->get(Sym);