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:
Lorenz Haas
2013-05-14 11:04:38 +02:00
committed by Nikolai Kosjar
parent aa3aa7c455
commit 17a81ae106
4 changed files with 22 additions and 31 deletions

View File

@@ -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()));
}
}