forked from qt-creator/qt-creator
Fixed lookup to skip over friend declarations.
This commit is contained in:
@@ -449,6 +449,9 @@ void ClassOrNamespace::lookup_helper(const Name *name, ClassOrNamespace *binding
|
|||||||
const Identifier *nameId = name->identifier();
|
const Identifier *nameId = name->identifier();
|
||||||
|
|
||||||
foreach (Symbol *s, binding->symbols()) {
|
foreach (Symbol *s, binding->symbols()) {
|
||||||
|
if (s->isFriend())
|
||||||
|
continue;
|
||||||
|
|
||||||
if (ScopedSymbol *scoped = s->asScopedSymbol()) {
|
if (ScopedSymbol *scoped = s->asScopedSymbol()) {
|
||||||
if (Class *klass = scoped->asClass()) {
|
if (Class *klass = scoped->asClass()) {
|
||||||
if (const Identifier *id = klass->identifier()) {
|
if (const Identifier *id = klass->identifier()) {
|
||||||
@@ -486,6 +489,8 @@ void CreateBindings::lookupInScope(const Name *name, Scope *scope,
|
|||||||
for (Symbol *s = scope->lookat(op->kind()); s; s = s->next()) {
|
for (Symbol *s = scope->lookat(op->kind()); s; s = s->next()) {
|
||||||
if (! s->name())
|
if (! s->name())
|
||||||
continue;
|
continue;
|
||||||
|
else if (s->isFriend())
|
||||||
|
continue;
|
||||||
else if (! s->name()->isEqualTo(op))
|
else if (! s->name()->isEqualTo(op))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -497,7 +502,9 @@ void CreateBindings::lookupInScope(const Name *name, Scope *scope,
|
|||||||
|
|
||||||
} else if (const Identifier *id = name->identifier()) {
|
} else if (const Identifier *id = name->identifier()) {
|
||||||
for (Symbol *s = scope->lookat(id); s; s = s->next()) {
|
for (Symbol *s = scope->lookat(id); s; s = s->next()) {
|
||||||
if (! id->isEqualTo(s->identifier()))
|
if (s->isFriend())
|
||||||
|
continue; // skip friends
|
||||||
|
else if (! id->isEqualTo(s->identifier()))
|
||||||
continue;
|
continue;
|
||||||
else if (s->name()->isQualifiedNameId())
|
else if (s->name()->isQualifiedNameId())
|
||||||
continue; // skip qualified ids.
|
continue; // skip qualified ids.
|
||||||
|
|||||||
Reference in New Issue
Block a user