C++: Fix lookup for instantiation by class object

Task-number: QTCREATORBUG-14352
Change-Id: I2ce4bc1d0dba2414afe050e80607b581686081a9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2015-04-24 09:55:20 +03:00
committed by Orgad Shaneh
parent ee37f60bff
commit 9b30795c02
10 changed files with 99 additions and 81 deletions

View File

@@ -601,7 +601,7 @@ public:
QSet<const Declaration *> _alreadyConsideredTypedefs;
Class *_rootClass;
const Name *_name; // For debug
const Name *_name;
bool _hasTypedefs;
};
@@ -1118,6 +1118,13 @@ LookupScope *LookupScopePrivate::lookupType_helper(
return r;
}
}
if (_instantiationOrigin) {
if (LookupScope *o = _instantiationOrigin->lookupType_helper(
name, processed, /*searchInEnclosingScope =*/ true, origin)) {
return o;
}
}
}
if (_parent && searchInEnclosingScope)
@@ -1529,6 +1536,10 @@ void Instantiator::instantiate(LookupScopePrivate *lookupScope,
if (!clone->enclosingScope()) // Not from the cache but just cloned.
clone->setEnclosingScope(s->enclosingScope());
instantiation->_symbols.append(clone);
if (s == instantiation->_rootClass) {
clone->setName(instantiation->_name);
instantiation->_rootClass = clone->asClass();
}
if (Q_UNLIKELY(debug)) {
Overview oo;
oo.showFunctionSignatures = true;