diff --git a/src/libs/cplusplus/FindUsages.cpp b/src/libs/cplusplus/FindUsages.cpp index 3d10e71346da43100a951b538fd038101fd26ba1..6c52a02e2a0aa9df2195b8fa9b6dde09cb655361 100644 --- a/src/libs/cplusplus/FindUsages.cpp +++ b/src/libs/cplusplus/FindUsages.cpp @@ -28,7 +28,6 @@ **************************************************************************/ #include "FindUsages.h" -#include "TypeOfExpression.h" #include "DeprecatedLookupContext.h" #include <Control.h> @@ -54,6 +53,7 @@ FindUsages::FindUsages(Document::Ptr doc, const Snapshot &snapshot) _inQProperty(false) { _snapshot.insert(_doc); + typeofExpression.init(_doc, _snapshot, _context.bindings()); } void FindUsages::setGlobalNamespaceBinding(NamespaceBindingPtr globalNamespaceBinding) @@ -269,9 +269,6 @@ void FindUsages::checkExpression(unsigned startToken, unsigned endToken) const QString expression = _source.mid(begin, end - begin); // qDebug() << "*** check expression:" << expression; - TypeOfExpression typeofExpression; - typeofExpression.init(_doc, _snapshot); - unsigned line, column; getTokenStartPosition(startToken, &line, &column); Scope *scope = _doc->scopeAt(line, column); diff --git a/src/libs/cplusplus/FindUsages.h b/src/libs/cplusplus/FindUsages.h index f945ea1c41f772b40b8f987b19fc7af692167101..97729fd49ab5f623bd2d6e42ad7442e4e4acae56 100644 --- a/src/libs/cplusplus/FindUsages.h +++ b/src/libs/cplusplus/FindUsages.h @@ -34,6 +34,7 @@ #include "CppDocument.h" #include "CppBindings.h" #include "Semantic.h" +#include "TypeOfExpression.h" #include <ASTVisitor.h> #include <QtCore/QSet> @@ -119,6 +120,7 @@ private: int _inSimpleDeclaration; bool _inQProperty; QSet<unsigned> _processed; + TypeOfExpression typeofExpression; }; } // end of namespace CPlusPlus