aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/raw_ostream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/raw_ostream.cpp')
-rw-r--r--lib/Support/raw_ostream.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp
index 008f85603e..f3a53a5061 100644
--- a/lib/Support/raw_ostream.cpp
+++ b/lib/Support/raw_ostream.cpp
@@ -196,10 +196,13 @@ void format_object_base::home() {
// raw_fd_ostream
//===----------------------------------------------------------------------===//
-/// raw_fd_ostream - Open the specified file for writing. If an error occurs,
-/// information about the error is put into ErrorInfo, and the stream should
-/// be immediately destroyed.
+/// raw_fd_ostream - Open the specified file for writing. If an error
+/// occurs, information about the error is put into ErrorInfo, and the
+/// stream should be immediately destroyed; the string will be empty
+/// if no error occurred.
raw_fd_ostream::raw_fd_ostream(const char *Filename, std::string &ErrorInfo) {
+ ErrorInfo.clear();
+
// Handle "-" as stdout.
if (Filename[0] == '-' && Filename[1] == 0) {
FD = STDOUT_FILENO;