forked from qt-creator/qt-creator
C++: Do not set binding block as instantiationOrigin
The binding in a block should not be used as an instantiationOrigin, because it will be deleted if it does not contain any blocks or namespaces or classes or enums. Instead of that we should look for first enclosing class or namespace. Task-number: QTCREATORBUG-11424 Change-Id: I0fc6e935495478f71372b0fe6f611887f45b2eda Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
committed by
Nikolai Kosjar
parent
a7d3340685
commit
5d3c070174
@@ -1069,6 +1069,10 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac
|
||||
instantiation->_name = templId;
|
||||
#endif // DEBUG_LOOKUP
|
||||
instantiation->_templateId = 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