From d27ecd8e9290699f618d3f035181bc2fe6025f55 Mon Sep 17 00:00:00 2001 From: Lukas Zaoral Date: Tue, 24 Aug 2021 13:59:21 +0200 Subject: Support/FileHandling.cpp: rewrite to C++14 --- lib/Support/FileHandling.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/Support') diff --git a/lib/Support/FileHandling.cpp b/lib/Support/FileHandling.cpp index bc65a641..9809b87d 100644 --- a/lib/Support/FileHandling.cpp +++ b/lib/Support/FileHandling.cpp @@ -22,10 +22,10 @@ namespace klee { std::unique_ptr klee_open_output_file(const std::string &path, std::string &error) { - error = ""; - std::unique_ptr f; + error.clear(); std::error_code ec; - f = std::unique_ptr(new llvm::raw_fd_ostream(path.c_str(), ec, llvm::sys::fs::F_None)); // FIXME C++14 + auto f = std::make_unique(path.c_str(), ec, + llvm::sys::fs::F_None); if (ec) error = ec.message(); if (!error.empty()) { @@ -37,8 +37,8 @@ klee_open_output_file(const std::string &path, std::string &error) { #ifdef HAVE_ZLIB_H std::unique_ptr klee_open_compressed_output_file(const std::string &path, std::string &error) { - error = ""; - std::unique_ptr f(new compressed_fd_ostream(path, error)); + error.clear(); + auto f = std::make_unique(path, error); if (!error.empty()) { f.reset(nullptr); } -- cgit 1.4.1