brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 6a6ca6b Raw
51 lines · cpp
1//===----------------------------------------------------------------------===//2//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-exception6//7//===----------------------------------------------------------------------===//8 9// <vector>10 11// ~vector<bool>() // implied noexcept;12 13// UNSUPPORTED: c++0314 15#include <cassert>16#include <vector>17#include <type_traits>18 19#include "test_macros.h"20#include "test_allocator.h"21 22template <class T>23struct some_alloc {24  typedef T value_type;25  some_alloc(const some_alloc&);26  ~some_alloc() noexcept(false);27};28 29int main(int, char**) {30  {31    typedef std::vector<bool> C;32    static_assert(std::is_nothrow_destructible<C>::value, "");33  }34  {35    typedef std::vector<bool, test_allocator<bool>> C;36    static_assert(std::is_nothrow_destructible<C>::value, "");37  }38  {39    typedef std::vector<bool, other_allocator<bool>> C;40    static_assert(std::is_nothrow_destructible<C>::value, "");41  }42#if defined(_LIBCPP_VERSION)43  {44    typedef std::vector<bool, some_alloc<bool>> C;45    static_assert(!std::is_nothrow_destructible<C>::value, "");46  }47#endif // _LIBCPP_VERSION48 49  return 0;50}51