From d9eab81cbbbfca761afa10b28d3682cf152aee21 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Fri, 24 Apr 2015 11:12:11 +0300 Subject: [PATCH] C++: Avoid duplicate entries in TypeResolver Change-Id: I094dc04a14c05b17815d53bf0170926cc0c0d2a5 Reviewed-by: Przemyslaw Gorszkowski --- src/libs/cplusplus/TypeResolver.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libs/cplusplus/TypeResolver.cpp b/src/libs/cplusplus/TypeResolver.cpp index 5e5249f2e19..10c69864dbc 100644 --- a/src/libs/cplusplus/TypeResolver.cpp +++ b/src/libs/cplusplus/TypeResolver.cpp @@ -79,8 +79,10 @@ QList TypeResolver::getNamedTypeItems(const Name *name, Scope *scope if (namedTypeItems.isEmpty()) { if (binding) namedTypeItems = binding->lookup(name); - if (LookupScope *scopeCon = _context.lookupType(scope)) - namedTypeItems += scopeCon->lookup(name); + if (LookupScope *scopeCon = _context.lookupType(scope)) { + if (scopeCon != binding) + namedTypeItems += scopeCon->lookup(name); + } } return namedTypeItems;