[TableGen] Don't use inline storage for ReferenceLocs (NFC) (#125231)
[llvm-project.git] / libcxx / test / std / containers / container.adaptors / queue / queue.cons / ctor_default.pass.cpp
blob17cb4a7936d21a75d3ef5d68539d627369bdeb16
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 //===----------------------------------------------------------------------===//
9 // <queue>
11 // explicit queue(Container&& = Container()); // before C++20
12 // queue() : queue(Container()) {} // C++20
13 // explicit queue(Container&&); // before C++20
15 #include <queue>
16 #include <cassert>
18 #include "test_macros.h"
19 #include "test_allocator.h"
20 #if TEST_STD_VER >= 11
21 #include "test_convertible.h"
22 #endif
24 int main(int, char**)
26 typedef std::vector<int, limited_allocator<int, 10> > Container;
27 typedef std::queue<int, Container> Q;
28 Q q;
29 assert(q.size() == 0);
30 q.push(1);
31 q.push(2);
32 assert(q.size() == 2);
33 assert(q.front() == 1);
34 assert(q.back() == 2);
36 #if TEST_STD_VER >= 11
37 // It should be explicit, so not convertible before C++20.
38 static_assert(test_convertible<Q>(), "");
39 #endif
41 return 0;