aboutsummaryrefslogtreecommitdiff
path: root/test/std/containers/sequences/list/list.modifiers/clear.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/containers/sequences/list/list.modifiers/clear.pass.cpp')
-rw-r--r--test/std/containers/sequences/list/list.modifiers/clear.pass.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/std/containers/sequences/list/list.modifiers/clear.pass.cpp b/test/std/containers/sequences/list/list.modifiers/clear.pass.cpp
new file mode 100644
index 000000000000..38696b6eb503
--- /dev/null
+++ b/test/std/containers/sequences/list/list.modifiers/clear.pass.cpp
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <list>
+
+// void clear();
+
+#include <list>
+#include <cassert>
+
+#include "min_allocator.h"
+
+int main()
+{
+ {
+ int a[] = {1, 2, 3};
+ std::list<int> c(a, a+3);
+ c.clear();
+ assert(c.empty());
+ }
+#if __cplusplus >= 201103L
+ {
+ int a[] = {1, 2, 3};
+ std::list<int, min_allocator<int>> c(a, a+3);
+ c.clear();
+ assert(c.empty());
+ }
+#endif
+}