xref: /llvm-project/libcxx/test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp (revision 31cbe0f240f660f15602c96b787c58a26f17e179)
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 
9 // UNSUPPORTED: c++03
10 
11 // <stack>
12 
13 // stack()
14 //        noexcept(is_nothrow_default_constructible<container_type>::value);
15 
16 // This tests a conforming extension
17 
18 
19 #include <stack>
20 #include <cassert>
21 
22 #include "test_macros.h"
23 #include "MoveOnly.h"
24 
main(int,char **)25 int main(int, char**)
26 {
27 #if defined(_LIBCPP_VERSION)
28     {
29         typedef std::stack<MoveOnly> C;
30         static_assert(std::is_nothrow_default_constructible<C>::value, "");
31     }
32 #endif
33 
34   return 0;
35 }
36