Skip to content

Commit

Permalink
Missed one of the try blocks the first time :-(. Thanks to Renato for…
Browse files Browse the repository at this point in the history
… the heads up.

llvm-svn: 286932
  • Loading branch information
mclow committed Nov 15, 2016
1 parent c79dc70 commit f7182fe
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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()
Expand Down

0 comments on commit f7182fe

Please sign in to comment.