[libcxx] r286932 - Missed one of the try blocks the first time :-(. Thanks to Renato for the heads up.

Marshall Clow via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 14 21:03:23 PST 2016


Author: marshall
Date: Mon Nov 14 23:03:22 2016
New Revision: 286932

URL: http://llvm.org/viewvc/llvm-project?rev=286932&view=rev
Log:
Missed one of the try blocks the first time :-(. Thanks to Renato for the heads up.

Modified:
    libcxx/trunk/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp

Modified: libcxx/trunk/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp?rev=286932&r1=286931&r2=286932&view=diff
==============================================================================
--- libcxx/trunk/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp (original)
+++ libcxx/trunk/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp Mon Nov 14 23:03:22 2016
@@ -64,7 +64,7 @@ test(SV sv, unsigned pos, unsigned n, co
 {
     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, co
         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()




More information about the cfe-commits mailing list