96 lines
2.9 KiB
Diff
96 lines
2.9 KiB
Diff
From 2d37749d00cf9293fa3c7e0e1d2eec13f5546834 Mon Sep 17 00:00:00 2001
|
|
From: Peter Dimov <pdimov@gmail.com>
|
|
Date: Mon, 4 Mar 2019 15:40:03 +0200
|
|
Subject: [PATCH] Enable -Wnon-virtual-dtor in warnings_test
|
|
|
|
---
|
|
test/Jamfile.v2 | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/test/Jamfile.v2 b/test/Jamfile.v2
|
|
index 6a24bd4..bf07950 100644
|
|
--- a/test/Jamfile.v2
|
|
+++ b/test/Jamfile.v2
|
|
@@ -61,4 +61,4 @@ system-run failed_constexpr_test.cpp ;
|
|
# Quick (CI) test
|
|
run quick.cpp ;
|
|
|
|
-run quick.cpp : : : <warnings>all <warnings-as-errors>on : warnings_test ;
|
|
+run quick.cpp : : : <warnings>all <warnings-as-errors>on <toolset>gcc:<cxxflags>-Wnon-virtual-dtor <toolset>clang:<cxxflags>-Wnon-virtual-dtor : warnings_test ;
|
|
--
|
|
2.20.1
|
|
|
|
From 0134441a6e628f407e77275b675e9a5757f65c0a Mon Sep 17 00:00:00 2001
|
|
From: Peter Dimov <pdimov@gmail.com>
|
|
Date: Mon, 4 Mar 2019 19:23:32 +0200
|
|
Subject: [PATCH] Add warnings_test.cpp; disable -Wnon-virtual-dtor on g++ <
|
|
4.6
|
|
|
|
---
|
|
test/Jamfile.v2 | 2 +-
|
|
test/warnings_test.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++
|
|
2 files changed, 43 insertions(+), 1 deletion(-)
|
|
create mode 100644 test/warnings_test.cpp
|
|
|
|
diff --git a/test/Jamfile.v2 b/test/Jamfile.v2
|
|
index bf07950..1648d46 100644
|
|
--- a/test/Jamfile.v2
|
|
+++ b/test/Jamfile.v2
|
|
@@ -61,4 +61,4 @@ system-run failed_constexpr_test.cpp ;
|
|
# Quick (CI) test
|
|
run quick.cpp ;
|
|
|
|
-run quick.cpp : : : <warnings>all <warnings-as-errors>on <toolset>gcc:<cxxflags>-Wnon-virtual-dtor <toolset>clang:<cxxflags>-Wnon-virtual-dtor : warnings_test ;
|
|
+run warnings_test.cpp : : : <warnings>all <warnings-as-errors>on <toolset>gcc:<cxxflags>-Wnon-virtual-dtor <toolset>clang:<cxxflags>-Wnon-virtual-dtor ;
|
|
diff --git a/test/warnings_test.cpp b/test/warnings_test.cpp
|
|
new file mode 100644
|
|
index 0000000..f7554e1
|
|
--- /dev/null
|
|
+++ b/test/warnings_test.cpp
|
|
@@ -0,0 +1,42 @@
|
|
+
|
|
+// Copyright 2017, 2019 Peter Dimov.
|
|
+//
|
|
+// Distributed under the Boost Software License, Version 1.0.
|
|
+//
|
|
+// See accompanying file LICENSE_1_0.txt or copy at
|
|
+// http://www.boost.org/LICENSE_1_0.txt
|
|
+
|
|
+// See library home page at http://www.boost.org/libs/system
|
|
+
|
|
+#include <boost/config.hpp>
|
|
+
|
|
+#if defined( BOOST_GCC ) && BOOST_GCC < 40600
|
|
+#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
|
|
+#endif
|
|
+
|
|
+#include <boost/system/error_code.hpp>
|
|
+#include <boost/core/lightweight_test.hpp>
|
|
+#include <cerrno>
|
|
+
|
|
+int main()
|
|
+{
|
|
+ boost::system::error_category const & bt = boost::system::generic_category();
|
|
+
|
|
+ int ev = ENOENT;
|
|
+
|
|
+ boost::system::error_code bc( ev, bt );
|
|
+
|
|
+ BOOST_TEST_EQ( bc.value(), ev );
|
|
+ BOOST_TEST_EQ( &bc.category(), &bt );
|
|
+
|
|
+ boost::system::error_condition bn = bt.default_error_condition( ev );
|
|
+
|
|
+ BOOST_TEST_EQ( bn.value(), ev );
|
|
+ BOOST_TEST_EQ( &bn.category(), &bt );
|
|
+
|
|
+ BOOST_TEST( bt.equivalent( ev, bn ) );
|
|
+
|
|
+ BOOST_TEST( bc == bn );
|
|
+
|
|
+ return boost::report_errors();
|
|
+}
|
|
--
|
|
2.20.1
|
|
|