Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2
diff options
context:
space:
mode:
authorMartin Hořeňovský2019-11-04 00:05:32 +0100
committerMartin Hořeňovský2020-02-12 19:21:15 +0100
commitc165bd15c5017137db38e149c8c8b68f1233fa96 (patch)
treee0770d3ddbfeb2fcf0aea4aece23b90f7dafb883 /src/catch2
parent4f0de7bbadc601a3c8a4457251d934213e61e902 (diff)
downloadcatch3-c165bd15c5017137db38e149c8c8b68f1233fa96.tar.gz
Forbid copying ReusableStringStream
Copying a `ReusableStringStream` would lead to "double free" of the stream, and thus it could be used in multiple places at the same time, breaking the output.
Diffstat (limited to 'src/catch2')
-rw-r--r--src/catch2/catch_stream.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/catch2/catch_stream.h b/src/catch2/catch_stream.h
index 2b41adbd..999849c9 100644
--- a/src/catch2/catch_stream.h
+++ b/src/catch2/catch_stream.h
@@ -9,6 +9,8 @@
#ifndef TWOBLUECUBES_CATCH_STREAM_H_INCLUDED
#define TWOBLUECUBES_CATCH_STREAM_H_INCLUDED
+#include "catch_common.h"
+
#include <iosfwd>
#include <cstddef>
#include <ostream>
@@ -28,7 +30,7 @@ namespace Catch {
auto makeStream( StringRef const &filename ) -> IStream const*;
- class ReusableStringStream {
+ class ReusableStringStream : NonCopyable {
std::size_t m_index;
std::ostream* m_oss;
public: