diff --git a/clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp b/clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp index aac017c0725d4..cdf2c6b988cf9 100644 --- a/clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp +++ b/clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp @@ -402,12 +402,6 @@ bool eligibleForExtraction(const SelectionTree::Node *N) { if (!ExprType || ExprType->isVoidType()) return false; - // Must know the type of the result in order to spell it, or instead use - // `auto` in C++. - if (!N->getDeclContext().getParentASTContext().getLangOpts().CPlusPlus11 && - !ExprType) - return false; - // A plain reference to a name (e.g. variable) isn't worth extracting. // FIXME: really? What if it's e.g. `std::is_same::value`? if (llvm::isa(E)) diff --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp b/clang-tools-extra/clangd/tool/ClangdMain.cpp index 27f70a527cd3c..865dd0a44aa4a 100644 --- a/clang-tools-extra/clangd/tool/ClangdMain.cpp +++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp @@ -879,7 +879,6 @@ clangd accepts flags on the commandline, and in the CLANGD_FLAGS environment var Opts.ResourceDir = ResourceDir; Opts.BuildDynamicSymbolIndex = true; std::vector> IdxStack; - std::unique_ptr StaticIdx; #if CLANGD_ENABLE_REMOTE if (RemoteIndexAddress.empty() != ProjectRoot.empty()) { llvm::errs() << "remote-index-address and project-path have to be " @@ -900,14 +899,7 @@ clangd accepts flags on the commandline, and in the CLANGD_FLAGS environment var Opts.ReferencesLimit = ReferencesLimit; Opts.Rename.LimitFiles = RenameFileLimit; auto PAI = createProjectAwareIndex(loadExternalIndex, Sync); - if (StaticIdx) { - IdxStack.emplace_back(std::move(StaticIdx)); - IdxStack.emplace_back( - std::make_unique(PAI.get(), IdxStack.back().get())); - Opts.StaticIndex = IdxStack.back().get(); - } else { - Opts.StaticIndex = PAI.get(); - } + Opts.StaticIndex = PAI.get(); Opts.AsyncThreadsCount = WorkerThreadsCount; Opts.MemoryCleanup = getMemoryCleanupFunction();