summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/containers/sequences/vector/vector.modifiers
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2018-08-22 04:28:43 +0000
committerMarshall Clow <mclow.lists@gmail.com>2018-08-22 04:28:43 +0000
commit934e9a3976db9d3535c9443e8dbbf96eca06c9a7 (patch)
tree57121829062be8851d181623c317f70f7479ea56 /libcxx/test/std/containers/sequences/vector/vector.modifiers
parentfdd73b5037c6e5e5b0523ccf891d4023ca4a26fd (diff)
downloadbcm5719-llvm-934e9a3976db9d3535c9443e8dbbf96eca06c9a7.tar.gz
bcm5719-llvm-934e9a3976db9d3535c9443e8dbbf96eca06c9a7.zip
Fix Bug 38644: multimap::clear() missing exception specifier. Add noexcept tests for all the containers that have clear().
llvm-svn: 340385
Diffstat (limited to 'libcxx/test/std/containers/sequences/vector/vector.modifiers')
-rw-r--r--libcxx/test/std/containers/sequences/vector/vector.modifiers/clear.pass.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libcxx/test/std/containers/sequences/vector/vector.modifiers/clear.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.modifiers/clear.pass.cpp
index 5f053eb8565..5357ba4cb28 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.modifiers/clear.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.modifiers/clear.pass.cpp
@@ -9,11 +9,12 @@
// <vector>
-// void clear();
+// void clear() noexcept;
#include <vector>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "asan_testing.h"
@@ -22,6 +23,7 @@ int main()
{
int a[] = {1, 2, 3};
std::vector<int> c(a, a+3);
+ ASSERT_NOEXCEPT(c.clear());
c.clear();
assert(c.empty());
LIBCPP_ASSERT(c.__invariants());
@@ -31,6 +33,7 @@ int main()
{
int a[] = {1, 2, 3};
std::vector<int, min_allocator<int>> c(a, a+3);
+ ASSERT_NOEXCEPT(c.clear());
c.clear();
assert(c.empty());
LIBCPP_ASSERT(c.__invariants());
OpenPOWER on IntegriCloud