summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang-tools-extra/clangd/JSONRPCDispatcher.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang-tools-extra/clangd/JSONRPCDispatcher.cpp b/clang-tools-extra/clangd/JSONRPCDispatcher.cpp
index 52493b23840..557fadbac06 100644
--- a/clang-tools-extra/clangd/JSONRPCDispatcher.cpp
+++ b/clang-tools-extra/clangd/JSONRPCDispatcher.cpp
@@ -12,6 +12,7 @@
#include "ProtocolHandlers.h"
#include "Trace.h"
#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/YAMLParser.h"
#include <istream>
@@ -149,7 +150,8 @@ bool JSONRPCDispatcher::call(StringRef Content, JSONOutput &Out) const {
ID.emplace(V.str());
} else {
double D;
- if (!V.getAsDouble(D))
+ // FIXME: this is locale-sensitive.
+ if (llvm::to_float(V, D))
ID.emplace(D);
}
}
OpenPOWER on IntegriCloud