Merge branch 'develop' of https://github.com/boostorg/smart_ptr into cppbuilder

This commit is contained in:
Edward Diener
2020-05-06 11:32:12 -04:00
4 changed files with 42 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -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
: <warnings>pedantic
<toolset>msvc:<warnings-as-errors>on
<toolset>gcc:<warnings-as-errors>on
<toolset>clang:<warnings-as-errors>on ;

14
test/sp_pedantic_test.cpp Normal file
View File

@ -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 <boost/smart_ptr.hpp>
int main()
{
boost::shared_ptr<int> p1( new int );
boost::shared_ptr<int[]> p2( new int[1] );
boost::make_shared<int>();
boost::make_shared<int[]>( 1 );
}