[clang-tools-extra] r347039 - [clangd] Fix a compiler warning and test crashes caused in rL347038.

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 16 01:41:14 PST 2018


Author: hokein
Date: Fri Nov 16 01:41:14 2018
New Revision: 347039

URL: http://llvm.org/viewvc/llvm-project?rev=347039&view=rev
Log:
[clangd] Fix a compiler warning and test crashes caused in rL347038.

Modified:
    clang-tools-extra/trunk/clangd/index/Background.cpp
    clang-tools-extra/trunk/clangd/index/Background.h

Modified: clang-tools-extra/trunk/clangd/index/Background.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/index/Background.cpp?rev=347039&r1=347038&r2=347039&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/index/Background.cpp (original)
+++ clang-tools-extra/trunk/clangd/index/Background.cpp Fri Nov 16 01:41:14 2018
@@ -43,7 +43,7 @@ BackgroundIndex::BackgroundIndex(
       URISchemes(URISchemes),
       IndexStorageFactory(std::move(IndexStorageFactory)) {
   assert(ThreadPoolSize > 0 && "Thread pool size can't be zero.");
-  assert(IndexStorageFactory && "Storage factory can not be null!");
+  assert(this->IndexStorageFactory && "Storage factory can not be null!");
   while (ThreadPoolSize--) {
     ThreadPool.emplace_back([this] { run(); });
     // Set priority to low, since background indexing is a long running task we

Modified: clang-tools-extra/trunk/clangd/index/Background.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/index/Background.h?rev=347039&r1=347038&r2=347039&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/index/Background.h (original)
+++ clang-tools-extra/trunk/clangd/index/Background.h Fri Nov 16 01:41:14 2018
@@ -32,6 +32,8 @@ namespace clangd {
 // operations can be called from multiple-threads concurrently.
 class BackgroundIndexStorage {
 public:
+  virtual ~BackgroundIndexStorage() = default;
+
   // Shards of the index are stored and retrieved independently, keyed by shard
   // identifier - in practice this is a source file name
   virtual llvm::Error storeShard(llvm::StringRef ShardIdentifier,




More information about the cfe-commits mailing list