From eb8998cd91bc4fbf015850e8b6c24ccd95f2727a Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 26 Apr 2020 18:27:35 +0300 Subject: [PATCH 1/4] Add Clang 10 to Travis --- .travis.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.travis.yml b/.travis.yml index a1dbeef..4dd35be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -299,6 +299,19 @@ matrix: - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main' key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' + - os: linux + dist: xenial + compiler: clang++-10 + env: TOOLSET=clang COMPILER=clang++-10 CXXSTD=03,11,14,17,2a + addons: + apt: + packages: + - clang-10 + sources: + - ubuntu-toolchain-r-test + - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-10 main' + key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' + - os: linux compiler: clang++-8 env: UBSAN=1 TOOLSET=clang COMPILER=clang++-8 CXXSTD=03,11,14,17,2a UBSAN_OPTIONS=print_stacktrace=1 From 9c43c69c145db77ef7b2e15dd3cb78ba3d8017ca Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 26 Apr 2020 19:57:05 +0300 Subject: [PATCH 2/4] Add sp_pedantic_test --- test/Jamfile | 1 + test/sp_pedantic_test.cpp | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 test/sp_pedantic_test.cpp diff --git a/test/Jamfile b/test/Jamfile index 0d31010..a3e2b4e 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -361,3 +361,4 @@ compile-fail shared_from_fail.cpp ; compile-fail weak_from_fail.cpp ; compile sp_override_test.cpp ; +compile sp_pedantic_test.cpp : pedantic on ; diff --git a/test/sp_pedantic_test.cpp b/test/sp_pedantic_test.cpp new file mode 100644 index 0000000..92df9c3 --- /dev/null +++ b/test/sp_pedantic_test.cpp @@ -0,0 +1,14 @@ +// Copyright 2020 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include + +int main() +{ + boost::shared_ptr p1( new int ); + boost::shared_ptr p2( new int[1] ); + + boost::make_shared(); + boost::make_shared( 1 ); +} From 066b398114ab48c81c875e95459c15c2416a7891 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 27 Apr 2020 00:50:15 +0300 Subject: [PATCH 3/4] Disable -Wc11-extensions in sp_counted_base_clang.hpp --- .../boost/smart_ptr/detail/sp_counted_base_clang.hpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/boost/smart_ptr/detail/sp_counted_base_clang.hpp b/include/boost/smart_ptr/detail/sp_counted_base_clang.hpp index 89bcfb8..2c3938f 100644 --- a/include/boost/smart_ptr/detail/sp_counted_base_clang.hpp +++ b/include/boost/smart_ptr/detail/sp_counted_base_clang.hpp @@ -26,6 +26,16 @@ namespace boost namespace detail { +#if defined(__clang__) +# pragma clang diagnostic push +#endif + +#if defined(__clang__) && defined(__has_warning) +# if __has_warning( "-Wc11-extensions" ) +# pragma clang diagnostic ignored "-Wc11-extensions" +# endif +#endif + typedef _Atomic( boost::int_least32_t ) atomic_int_least32_t; inline void atomic_increment( atomic_int_least32_t * pw ) BOOST_SP_NOEXCEPT @@ -61,7 +71,6 @@ inline boost::int_least32_t atomic_conditional_increment( atomic_int_least32_t * } #if defined(__clang__) -# pragma clang diagnostic push # pragma clang diagnostic ignored "-Wweak-vtables" #endif From 02cc561248c8da92d7974fa6b243d30dc5331079 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 28 Apr 2020 05:05:57 +0300 Subject: [PATCH 4/4] Only use warnings-as-errors on msvc, gcc, clang --- test/Jamfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/Jamfile b/test/Jamfile index a3e2b4e..0ed0d68 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -361,4 +361,8 @@ compile-fail shared_from_fail.cpp ; compile-fail weak_from_fail.cpp ; compile sp_override_test.cpp ; -compile sp_pedantic_test.cpp : pedantic on ; +compile sp_pedantic_test.cpp + : pedantic + msvc:on + gcc:on + clang:on ;