Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
Qt Creator 4.9.2
-
None
-
-
9ee693ee229d28bd618e8dd44bc6b12750d43a29 (qt-creator/qt-creator/master)
Description
"Find References to Symbol Under Cursor" doesn't work for std::shared_ptr's function call (right click on bar() in example) when using MSVC 2017.
#include <memory> struct foo { int bar(){return 1;} }; int main() { std::shared_ptr<foo> sharedPtr(new foo()); int res=sharedPtr->bar(); // <<< --- HERE find references on "bar" doesn't work return res; }
It fails in cpprefactoringengine.cpp - canonicalSymbol is null:
void CppRefactoringEngine::findUsages(const CursorInEditor &data, UsagesCallback &&) const { [...] if (const CPlusPlus::Macro *macro = findCanonicalMacro(cursor, info.doc)) { modelManager->findMacroUsages(*macro); } else { CanonicalSymbol cs(info.doc, info.snapshot); CPlusPlus::Symbol *canonicalSymbol = cs(cursor); if (canonicalSymbol) // <<< --- HERE modelManager->findUsages(canonicalSymbol, cs.context()); } }
It works OK when MSVC 2015 compiler used.
Attachments
Issue Links
- relates to
-
QTCREATORBUG-7866 Class name after __declspec(dllexport) is not highlighted
- Closed