1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
13 // explicit operator bool() const;
17 #include <type_traits>
19 #include "test_macros.h"
29 static_assert(std::is_constructible
<bool, std::shared_ptr
<A
> >::value
, "");
30 static_assert(!std::is_convertible
<std::shared_ptr
<A
>, bool>::value
, "");
33 const std::shared_ptr
<int> p(new int(32));
37 const std::shared_ptr
<int> p
;
40 #if !defined(TEST_HAS_NO_RTTI)
42 std::shared_ptr
<A
> basePtr
= std::make_shared
<B
>();
43 std::shared_ptr
<B
> sp
= std::dynamic_pointer_cast
<B
>(basePtr
);