forked from qt-creator/qt-creator
C++: fix used template function parameters
It was missing colorizing and follow symbol template function parameters in case of: * returning value * use it as qualified name Task-number: QTCREATORBUG-6861 Change-Id: I4226199e1f296cfe5a373783ebbc633e32fc9bcd Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
committed by
Erik Verbruggen
parent
feff33827c
commit
f93758b8e1
@@ -408,6 +408,14 @@ Scope *CheckSymbols::enclosingScope() const
|
||||
if (funDef->symbol)
|
||||
return funDef->symbol;
|
||||
|
||||
} else if (TemplateDeclarationAST *templateDeclaration = ast->asTemplateDeclaration()) {
|
||||
if (DeclarationAST *decl = templateDeclaration->declaration) {
|
||||
if (FunctionDefinitionAST *funDef = decl->asFunctionDefinition()) {
|
||||
if (funDef->symbol)
|
||||
return funDef->symbol;
|
||||
}
|
||||
}
|
||||
|
||||
} else if (CompoundStatementAST *blockStmt = ast->asCompoundStatement()) {
|
||||
if (blockStmt->symbol)
|
||||
return blockStmt->symbol;
|
||||
@@ -869,7 +877,12 @@ ClassOrNamespace *CheckSymbols::checkNestedName(QualifiedNameAST *ast)
|
||||
|
||||
const Name *name = class_or_namespace_name->name;
|
||||
binding = _context.lookupType(name, enclosingScope());
|
||||
addType(binding, class_or_namespace_name);
|
||||
if (binding)
|
||||
addType(binding, class_or_namespace_name);
|
||||
else
|
||||
// for the case when we use template parameter as qualifier
|
||||
// e.g.: template <typename T> void fun() { T::type type; }
|
||||
accept(nested_name_specifier->class_or_namespace_name);
|
||||
|
||||
for (it = it->next; it; it = it->next) {
|
||||
NestedNameSpecifierAST *nested_name_specifier = it->value;
|
||||
|
Reference in New Issue
Block a user