diff options
author | Lukas Zaoral <lzaoral@redhat.com> | 2021-08-24 13:59:21 +0200 |
---|---|---|
committer | MartinNowack <2443641+MartinNowack@users.noreply.github.com> | 2021-12-20 14:36:51 +0000 |
commit | d27ecd8e9290699f618d3f035181bc2fe6025f55 (patch) | |
tree | 522d6601efc24811d394386bcc09f84c7d8bda8b /lib/Support | |
parent | 9aa216c819ee2f97a5423efb2cd46e2176352e5a (diff) | |
download | klee-d27ecd8e9290699f618d3f035181bc2fe6025f55.tar.gz |
Support/FileHandling.cpp: rewrite to C++14
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/FileHandling.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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<llvm::raw_fd_ostream> klee_open_output_file(const std::string &path, std::string &error) { - error = ""; - std::unique_ptr<llvm::raw_fd_ostream> f; + error.clear(); std::error_code ec; - f = std::unique_ptr<llvm::raw_fd_ostream>(new llvm::raw_fd_ostream(path.c_str(), ec, llvm::sys::fs::F_None)); // FIXME C++14 + auto f = std::make_unique<llvm::raw_fd_ostream>(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<llvm::raw_ostream> klee_open_compressed_output_file(const std::string &path, std::string &error) { - error = ""; - std::unique_ptr<llvm::raw_ostream> f(new compressed_fd_ostream(path, error)); + error.clear(); + auto f = std::make_unique<compressed_fd_ostream>(path, error); if (!error.empty()) { f.reset(nullptr); } |