]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/smart_ptr/test/make_local_shared_array_throws_test.cpp
2 Copyright 2017 Glen Joseph Fernandes
5 Distributed under the Boost Software License, Version 1.0.
6 (http://www.boost.org/LICENSE_1_0.txt)
8 #include <boost/config.hpp>
9 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \
10 !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
11 #include <boost/detail/lightweight_test.hpp>
12 #include <boost/smart_ptr/make_local_shared.hpp>
16 static unsigned instances
;
31 type
& operator=(const type
&);
34 unsigned type::instances
= 0;
39 boost::make_local_shared
<type
[]>(6);
40 BOOST_ERROR("make_local_shared did not throw");
42 BOOST_TEST(type::instances
== 0);
45 boost::make_local_shared
<type
[][2]>(3);
46 BOOST_ERROR("make_local_shared did not throw");
48 BOOST_TEST(type::instances
== 0);
51 boost::make_local_shared
<type
[6]>();
52 BOOST_ERROR("make_local_shared did not throw");
54 BOOST_TEST(type::instances
== 0);
57 boost::make_local_shared
<type
[3][2]>();
58 BOOST_ERROR("make_local_shared did not throw");
60 BOOST_TEST(type::instances
== 0);
63 boost::make_local_shared_noinit
<type
[]>(6);
64 BOOST_ERROR("make_local_shared_noinit did not throw");
66 BOOST_TEST(type::instances
== 0);
69 boost::make_local_shared_noinit
<type
[][2]>(3);
70 BOOST_ERROR("make_local_shared_noinit did not throw");
72 BOOST_TEST(type::instances
== 0);
75 boost::make_local_shared_noinit
<type
[6]>();
76 BOOST_ERROR("make_local_shared_noinit did not throw");
78 BOOST_TEST(type::instances
== 0);
81 boost::make_local_shared_noinit
<type
[3][2]>();
82 BOOST_ERROR("make_local_shared_noinit did not throw");
84 BOOST_TEST(type::instances
== 0);
86 return boost::report_errors();