forked from qt-creator/qt-creator
CppTools: findMatchingDefinition handles const and volatile
Strict set to true, SymbolFinder::findMatchingDefinition will now also check, if const and volatile matches. Changed return type from 'Symbol *' to 'Function *' since only functions are returned. Change-Id: Ib55cb12b6c404e94fcefd0613b964e8caa425690 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
committed by
Nikolai Kosjar
parent
aa3aa7c455
commit
17a81ae106
@@ -257,11 +257,11 @@ static Document::Ptr findDefinition(Function *functionDeclaration, int *line)
|
||||
if (CppTools::CppModelManagerInterface *cppModelManager = CppTools::CppModelManagerInterface::instance()) {
|
||||
const Snapshot snapshot = cppModelManager->snapshot();
|
||||
CppTools::SymbolFinder symbolFinder;
|
||||
if (Symbol *def = symbolFinder.findMatchingDefinition(functionDeclaration, snapshot)) {
|
||||
if (Function *fun = symbolFinder.findMatchingDefinition(functionDeclaration, snapshot)) {
|
||||
if (line)
|
||||
*line = def->line();
|
||||
*line = fun->line();
|
||||
|
||||
return snapshot.document(QString::fromUtf8(def->fileName(), def->fileNameLength()));
|
||||
return snapshot.document(QString::fromUtf8(fun->fileName(), fun->fileNameLength()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user