From 53a420fba21cf1644972b34dcd811a43cdb8368d Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 2 Jan 2017 19:18:58 +0000 Subject: Vendor import of libc++ trunk r290819: https://llvm.org/svn/llvm-project/libcxx/trunk@290819 --- test/std/strings/basic.string/string.capacity/capacity.pass.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test/std/strings/basic.string/string.capacity/capacity.pass.cpp') diff --git a/test/std/strings/basic.string/string.capacity/capacity.pass.cpp b/test/std/strings/basic.string/string.capacity/capacity.pass.cpp index 4b09c096792c9..79fbd2e963221 100644 --- a/test/std/strings/basic.string/string.capacity/capacity.pass.cpp +++ b/test/std/strings/basic.string/string.capacity/capacity.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: libcpp-no-exceptions // // size_type capacity() const; @@ -18,21 +17,27 @@ #include "test_allocator.h" #include "min_allocator.h" +#include "test_macros.h" + template void test(S s) { S::allocator_type::throw_after = 0; +#ifndef TEST_HAS_NO_EXCEPTIONS try +#endif { while (s.size() < s.capacity()) s.push_back(typename S::value_type()); assert(s.size() == s.capacity()); } +#ifndef TEST_HAS_NO_EXCEPTIONS catch (...) { assert(false); } +#endif S::allocator_type::throw_after = INT_MAX; } -- cgit v1.2.3