blob: 1471c39ebb0742206b06285f5de27073e074d71e [file] [log] [blame]
Marshall Clowa17cd7c2017-11-15 01:33:33 +00001//===----------------------------------------------------------------------===//
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// class vector
13
14// bool empty() const noexcept;
15
16#include <vector>
17#include <cassert>
18
19#include "test_macros.h"
20#include "min_allocator.h"
21
22int main()
23{
24 {
25 typedef std::vector<bool> C;
26 C c;
27 ASSERT_NOEXCEPT(c.empty());
28 assert(c.empty());
29 c.push_back(false);
30 assert(!c.empty());
31 c.clear();
32 assert(c.empty());
33 }
34#if TEST_STD_VER >= 11
35 {
36 typedef std::vector<bool, min_allocator<bool>> C;
37 C c;
38 ASSERT_NOEXCEPT(c.empty());
39 assert(c.empty());
40 c.push_back(false);
41 assert(!c.empty());
42 c.clear();
43 assert(c.empty());
44 }
45#endif
46}