1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 // <vector>
11 
12 // void pop_back();
13 
14 #if _LIBCPP_DEBUG >= 1
15 #define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
16 #endif
17 
18 #include <vector>
19 #include <cassert>
20 #include "../../../stack_allocator.h"
21 #include "min_allocator.h"
22 
23 #if _LIBCPP_DEBUG >= 1
24 #include <cstdlib>
25 #include <exception>
26 
27 #endif
28 
main()29 int main()
30 {
31     {
32         std::vector<int> c;
33         c.push_back(1);
34         assert(c.size() == 1);
35         c.pop_back();
36         assert(c.size() == 0);
37 #if _LIBCPP_DEBUG >= 1
38         c.pop_back();
39         assert(false);
40 #endif
41     }
42 #if __cplusplus >= 201103L
43     {
44         std::vector<int, min_allocator<int>> c;
45         c.push_back(1);
46         assert(c.size() == 1);
47         c.pop_back();
48         assert(c.size() == 0);
49 #if _LIBCPP_DEBUG >= 1
50         c.pop_back();
51         assert(false);
52 #endif
53     }
54 #endif
55 }
56