Commit 5cd21238 authored by Christian Kamm's avatar Christian Kamm

C++: Fix findMatchingDeclaration for functions not in a class.

That fixes navigation and the 'function signature update' quickfix for
global functions and functions in namespaces.

Task-number: QTCREATORBUG-6413
Change-Id: Ifc68a88a34eb363f4e84c72e9f72444d22df1086
Reviewed-by: default avatarLeandro T. C. Melo <>
parent 4521be25
......@@ -918,11 +918,11 @@ void CPlusPlus::findMatchingDeclaration(const LookupContext &context,
foreach (Symbol *s, binding->symbols()) {
Class *matchingClass = s->asClass();
if (!matchingClass)
Scope *scope = s->asScope();
if (!scope)
for (Symbol *s = matchingClass->find(funcId); s; s = s->next()) {
for (Symbol *s = scope->find(funcId); s; s = s->next()) {
if (! s->name())
else if (! funcId->isEqualTo(s->identifier()))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment