forked from qt-creator/qt-creator
C++: Fix instantiation of typedefed type in block
Use-case:
template<typename T>
struct Temp { T t; };
struct Foo { int bar; };
void func()
{
typedef Foo *pointer;
Temp<pointer> temp;
temp.t->bar; // bar not highlighted
}
Task-number: QTCREATORBUG-14351
Change-Id: I13ca6145a0069bbc7a7207f69b43011c69ec72c7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
ad4cb444fb
commit
6a9bd957cb
@@ -993,7 +993,7 @@ LookupScope *LookupScope::lookupType(const Name *name, Block *block)
|
||||
= nestedBlock->d->lookupType_helper(name,
|
||||
&processed,
|
||||
/*searchInEnclosingScope = */ true,
|
||||
d)) {
|
||||
nestedBlock->d)) {
|
||||
return foundInNestedBlock;
|
||||
}
|
||||
}
|
||||
@@ -1339,9 +1339,6 @@ LookupScopePrivate *LookupScopePrivate::nestedType(const Name *name, LookupScope
|
||||
_alreadyConsideredTemplates.insert(templId);
|
||||
LookupScopePrivate *instantiation = baseTemplateClassReference->allocateChild(templId);
|
||||
|
||||
while (!origin->_symbols.isEmpty() && origin->_symbols[0]->isBlock())
|
||||
origin = origin->_parent;
|
||||
|
||||
instantiation->_instantiationOrigin = origin;
|
||||
|
||||
// The instantiation should have all symbols, enums, and usings from the reference.
|
||||
|
||||
Reference in New Issue
Block a user