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

summaryrefslogtreecommitdiffhomepage
path: root/examples/231-Cfg-OutputStreams.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2019-10-29 23:38:21 +0100
committerMartin Hořeňovský2019-10-31 16:19:56 +0100
commit2c6ace04a74458003506befea9291f5e60078bae (patch)
treebf57795f37075268e76d7a09ea45ab4c3a65ea08 /examples/231-Cfg-OutputStreams.cpp
parent7c48ea6016831f3e6afab0a902022dd59e417f82 (diff)
downloadcatch3-2c6ace04a74458003506befea9291f5e60078bae.tar.gz
Redo build matrix on .travis for C++14 and up
* Use Xenial as the base distribution * Remove C++11 builds * Add a lot more C++14 builds * Add some C++17 builds * Include newer versions of Clang and GCC
Diffstat (limited to 'examples/231-Cfg-OutputStreams.cpp')
-rw-r--r--examples/231-Cfg-OutputStreams.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/examples/231-Cfg-OutputStreams.cpp b/examples/231-Cfg-OutputStreams.cpp
index efa99971..2f42c297 100644
--- a/examples/231-Cfg-OutputStreams.cpp
+++ b/examples/231-Cfg-OutputStreams.cpp
@@ -10,11 +10,12 @@
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
+
class out_buff : public std::stringbuf {
std::FILE* m_stream;
public:
- out_buff(std::FILE* stream) :m_stream(stream) {}
- ~out_buff() { pubsync(); }
+ out_buff(std::FILE* stream):m_stream(stream) {}
+ ~out_buff();
int sync() {
int ret = 0;
for (unsigned char c : str()) {
@@ -29,6 +30,12 @@ public:
}
};
+out_buff::~out_buff() { pubsync(); }
+
+#if defined(__clang__)
+#pragma clang diagnostic ignored "-Wexit-time-destructors" // static variables in cout/cerr/clog
+#endif
+
namespace Catch {
std::ostream& cout() {
static std::ostream ret(new out_buff(stdout));