Fix string conversions functions to throw out_of_range properly.  Fixes http://llvm.org/bugs/show_bug.cgi?id=14919.

llvm-svn: 172447
diff --git a/libcxx/test/strings/string.conversions/stof.pass.cpp b/libcxx/test/strings/string.conversions/stof.pass.cpp
index 749d867..444a695 100644
--- a/libcxx/test/strings/string.conversions/stof.pass.cpp
+++ b/libcxx/test/strings/string.conversions/stof.pass.cpp
@@ -32,23 +32,24 @@
     idx = 0;
     assert(std::stof(L"10g", &idx) == 10);
     assert(idx == 2);
+    idx = 0;
     try
     {
         assert(std::stof("1.e60", &idx) == INFINITY);
-        assert(idx == 5);
+        assert(false);
     }
     catch (const std::out_of_range&)
     {
-        assert(false);
+        assert(idx == 0);
     }
     try
     {
         assert(std::stof(L"1.e60", &idx) == INFINITY);
-        assert(idx == 5);
+        assert(false);
     }
     catch (const std::out_of_range&)
     {
-        assert(false);
+        assert(idx == 0);
     }
     idx = 0;
     try
diff --git a/libcxx/test/strings/string.conversions/stoll.pass.cpp b/libcxx/test/strings/string.conversions/stoll.pass.cpp
index 217f00d..3887b7d 100644
--- a/libcxx/test/strings/string.conversions/stoll.pass.cpp
+++ b/libcxx/test/strings/string.conversions/stoll.pass.cpp
@@ -86,4 +86,13 @@
     {
         assert(idx == 0);
     }
+    try
+    {
+        std::stoll("99999999999999999999999999", &idx);
+        assert(false);
+    }
+    catch (const std::out_of_range&)
+    {
+        assert(idx == 0);
+    }
 }