diff --git a/src/plugins/cpptools/cppfindreferences.cpp b/src/plugins/cpptools/cppfindreferences.cpp
index fce5d3451d9b4327d2df9d29ed2bf48e6543f0ad..3fa8a3116526e81d87706945a7f518c3495ad4f8 100644
--- a/src/plugins/cpptools/cppfindreferences.cpp
+++ b/src/plugins/cpptools/cppfindreferences.cpp
@@ -439,7 +439,6 @@ static void find_helper(QFutureInterface<Core::Utils::FileSearchResult> &future,
 
 void CppFindReferences::findAll(Symbol *symbol)
 {
-    const bool wasInReplaceMode = _resultWindow->isShowingReplaceUI();
     _resultWindow->clearContents();
     _resultWindow->setShowReplaceUI(true);
     _resultWindow->popup(true);