[clang-tools-extra] r318798 - [clangd] avoid divide by literal zero to satisfy msvc

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 21 11:37:35 PST 2017


Author: sammccall
Date: Tue Nov 21 11:37:35 2017
New Revision: 318798

URL: http://llvm.org/viewvc/llvm-project?rev=318798&view=rev
Log:
[clangd] avoid divide by literal zero to satisfy msvc

Modified:
    clang-tools-extra/trunk/unittests/clangd/JSONExprTests.cpp

Modified: clang-tools-extra/trunk/unittests/clangd/JSONExprTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clangd/JSONExprTests.cpp?rev=318798&r1=318797&r2=318798&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clangd/JSONExprTests.cpp (original)
+++ clang-tools-extra/trunk/unittests/clangd/JSONExprTests.cpp Tue Nov 21 11:37:35 2017
@@ -131,7 +131,7 @@ TEST(JSONTest, Parse) {
   Compare(R"(42)", 42);
   Compare(R"(2.5)", 2.5);
   Compare(R"(2e50)", 2e50);
-  Compare(R"(1.2e3456789)", 1.0 / 0.0);
+  Compare(R"(1.2e3456789)", std::numeric_limits<double>::infinity());
 
   Compare(R"("foo")", "foo");
   Compare(R"("\"\\\b\f\n\r\t")", "\"\\\b\f\n\r\t");




More information about the cfe-commits mailing list