diff options
author | Andres Noetzli <noetzli@stanford.edu> | 2019-07-22 18:39:12 -0400 |
---|---|---|
committer | Aina Niemetz <aina.niemetz@gmail.com> | 2019-07-22 15:39:12 -0700 |
commit | 5d203980cb011ce0a9aa5007d4792c1f80dd1e4b (patch) | |
tree | 2730abeaf4430217720d17aa3c5068901815291a /src/proof/er/er_proof.cpp | |
parent | ed8f4388c859595178e303f65393105e99d4eb59 (diff) |
Avoid move constructor of std::fstream for GCC < 5 (#3098)
GCC < 5 does not support the move constructor of `std::fstream` (see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54316 for details). This
commit wraps the `std::fstream` in an `std::unique_ptr` to work around
that issue.
Diffstat (limited to 'src/proof/er/er_proof.cpp')
-rw-r--r-- | src/proof/er/er_proof.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/proof/er/er_proof.cpp b/src/proof/er/er_proof.cpp index ab07875b2..9f22e236b 100644 --- a/src/proof/er/er_proof.cpp +++ b/src/proof/er/er_proof.cpp @@ -91,16 +91,17 @@ ErProof ErProof::fromBinaryDratProof( std::string tracecheckFilename("cvc4-tracecheck-er-XXXXXX"); // Write the formula - std::fstream formStream = openTmpFile(&formulaFilename); - printDimacs(formStream, clauses, usedIds); - formStream.close(); + std::unique_ptr<std::fstream> formStream = openTmpFile(&formulaFilename); + printDimacs(*formStream, clauses, usedIds); + formStream->close(); // Write the (binary) DRAT proof - std::fstream dratStream = openTmpFile(&dratFilename); - dratStream << dratBinary; - dratStream.close(); + std::unique_ptr<std::fstream> dratStream = openTmpFile(&dratFilename); + (*dratStream) << dratBinary; + dratStream->close(); - std::fstream tracecheckStream = openTmpFile(&tracecheckFilename); + std::unique_ptr<std::fstream> tracecheckStream = + openTmpFile(&tracecheckFilename); // Invoke drat2er { @@ -120,9 +121,9 @@ ErProof ErProof::fromBinaryDratProof( } // Parse the resulting TRACECHECK proof into an ER proof. - TraceCheckProof pf = TraceCheckProof::fromText(tracecheckStream); + TraceCheckProof pf = TraceCheckProof::fromText(*tracecheckStream); ErProof proof(clauses, usedIds, std::move(pf)); - tracecheckStream.close(); + tracecheckStream->close(); remove(formulaFilename.c_str()); remove(dratFilename.c_str()); |