diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2016-11-15 05:03:22 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2016-11-15 05:03:22 +0000 |
commit | f7182fe464c792b937c7862a98d6c4ad6a95d416 (patch) | |
tree | e6de01f52cf3cb51afa081d9d95f2cf6fc3e8f4f /libcxx/test/std | |
parent | c79dc70d500f0615b5543f0c73715aed07610d7a (diff) | |
download | bcm5719-llvm-f7182fe464c792b937c7862a98d6c4ad6a95d416.tar.gz bcm5719-llvm-f7182fe464c792b937c7862a98d6c4ad6a95d416.zip |
Missed one of the try blocks the first time :-(. Thanks to Renato for the heads up.
llvm-svn: 286932
Diffstat (limited to 'libcxx/test/std')
-rw-r--r-- | libcxx/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/libcxx/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp index 144a1ab1f58..0b75a6cf0dc 100644 --- a/libcxx/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp @@ -64,7 +64,7 @@ test(SV sv, unsigned pos, unsigned n, const typename S::allocator_type& a) { typedef typename S::traits_type T; typedef typename S::allocator_type A; - try + if (pos <= sv.size()) { S s2(sv, pos, n, a); LIBCPP_ASSERT(s2.__invariants()); @@ -75,10 +75,20 @@ test(SV sv, unsigned pos, unsigned n, const typename S::allocator_type& a) assert(s2.get_allocator() == a); assert(s2.capacity() >= s2.size()); } - catch (std::out_of_range&) +#ifndef TEST_HAS_NO_EXCEPTIONS + else { - assert(pos > sv.size()); + try + { + S s2(sv, pos, n, a); + assert(false); + } + catch (std::out_of_range&) + { + assert(pos > sv.size()); + } } +#endif } int main() |