default_noexcept.pass.cpp 917 B

123456789101112131415161718192021222324252627282930313233343536
  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. // <queue>
  10. // priority_queue()
  11. // noexcept(is_nothrow_default_constructible<container_type>::value &&
  12. // is_nothrow_default_constructible<Compare>::value);
  13. // This tests a conforming extension
  14. #include <queue>
  15. #include <cassert>
  16. #include "test_macros.h"
  17. #include "MoveOnly.h"
  18. int main(int, char**)
  19. {
  20. #if defined(_LIBCPP_VERSION)
  21. {
  22. typedef std::priority_queue<MoveOnly> C;
  23. static_assert(std::is_nothrow_default_constructible<C>::value, "");
  24. }
  25. #endif
  26. return 0;
  27. }