diff options
Diffstat (limited to 'lib/AST/ASTDiagnostic.cpp')
-rw-r--r-- | lib/AST/ASTDiagnostic.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/AST/ASTDiagnostic.cpp b/lib/AST/ASTDiagnostic.cpp index 6a950d8dfe..d956eeee17 100644 --- a/lib/AST/ASTDiagnostic.cpp +++ b/lib/AST/ASTDiagnostic.cpp @@ -313,7 +313,8 @@ void clang::FormatASTNodeDiagnosticArgument( Qualified = false; } const NamedDecl *ND = reinterpret_cast<const NamedDecl*>(Val); - ND->getNameForDiagnostic(S, Context.getPrintingPolicy(), Qualified); + llvm::raw_string_ostream OS(S); + ND->getNameForDiagnostic(OS, Context.getPrintingPolicy(), Qualified); break; } case DiagnosticsEngine::ak_nestednamespec: { @@ -348,7 +349,10 @@ void clang::FormatASTNodeDiagnosticArgument( S += "function "; S += "'"; - ND->getNameForDiagnostic(S, Context.getPrintingPolicy(), true); + { + llvm::raw_string_ostream OS(S); + ND->getNameForDiagnostic(OS, Context.getPrintingPolicy(), true); + } S += "'"; } NeedQuotes = false; |