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 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 diff --git a/test/Jamfile b/test/Jamfile index 0d31010..0ed0d68 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -361,3 +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 + msvc:on + gcc:on + clang: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 ); +}