move_noexcept.pass.cpp 828 B

12345678910111213141516171819202122232425262728293031323334
  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-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. // UNSUPPORTED: c++98, c++03
  9. // <stack>
  10. // stack(stack&&)
  11. // noexcept(is_nothrow_move_constructible<container_type>::value);
  12. // This tests a conforming extension
  13. #include <stack>
  14. #include <cassert>
  15. #include "test_macros.h"
  16. #include "MoveOnly.h"
  17. int main(int, char**)
  18. {
  19. #if defined(_LIBCPP_VERSION)
  20. {
  21. typedef std::stack<MoveOnly> C;
  22. static_assert(std::is_nothrow_move_constructible<C>::value, "");
  23. }
  24. #endif
  25. return 0;
  26. }