CppEditor: Fix switch statement completion

... for the case where the value is retrieved via a call to a template
function whose scope does not include the template type.

Fixes: QTCREATORBUG-25998
Change-Id: Ie33817f445fb53595b783f716093637926297549
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2021-07-27 12:36:21 +02:00
parent ec9f972355
commit 2798c11d1d
2 changed files with 29 additions and 1 deletions

View File

@@ -910,7 +910,7 @@ bool ResolveExpression::visit(CallAST *ast)
if (Symbol *declaration = templateTy->declaration()) {
if (Function *funTy = declaration->asFunction()) {
if (maybeValidPrototype(funTy, actualArgumentCount))
addResult(funTy->returnType().simplified(), scope);
addResult(funTy->returnType().simplified(), _scope);
}
}
}