diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2015-04-20 00:06:58 +0300 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2015-04-20 13:37:35 +0000 |
commit | 29ac9fc65f04db4f7206bcdaaa44521c41895aff (patch) | |
tree | 861e0fa4cb73250bc4e7c90f3893fd16db5df793 /src/libs/cplusplus/ResolveExpression.cpp | |
parent | e5d8dbd070506409e33c6547d9d80a852ab8b3f0 (diff) | |
download | qt-creator-29ac9fc65f04db4f7206bcdaaa44521c41895aff.tar.gz |
C++: Remove DeprecatedGenTemplateInstance
It's, well, deprecated...
Change-Id: Ie9d7e80345a8d9404f702dd877b3e940a1a49d93
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Diffstat (limited to 'src/libs/cplusplus/ResolveExpression.cpp')
-rw-r--r-- | src/libs/cplusplus/ResolveExpression.cpp | 42 |
1 files changed, 12 insertions, 30 deletions
diff --git a/src/libs/cplusplus/ResolveExpression.cpp b/src/libs/cplusplus/ResolveExpression.cpp index e38d634b8c..d80036b74d 100644 --- a/src/libs/cplusplus/ResolveExpression.cpp +++ b/src/libs/cplusplus/ResolveExpression.cpp @@ -32,7 +32,6 @@ #include "LookupContext.h" #include "Overview.h" -#include "DeprecatedGenTemplateInstance.h" #include "CppRewriter.h" #include "TypeOfExpression.h" #include "TypeResolver.h" @@ -493,14 +492,12 @@ bool ResolveExpression::visit(UnaryExpressionAST *ast) Symbol *overload = r.declaration(); if (Function *funTy = overload->type()->asFunctionType()) { if (maybeValidPrototype(funTy, 0)) { - if (Function *proto = instantiate(b->templateId(), funTy)->asFunctionType()) { - FullySpecifiedType retTy = proto->returnType().simplified(); - p.setType(retTy); - p.setScope(proto->enclosingScope()); - it.setValue(p); - added = true; - break; - } + FullySpecifiedType retTy = funTy->returnType().simplified(); + p.setType(retTy); + p.setScope(funTy->enclosingScope()); + it.setValue(p); + added = true; + break; } } } @@ -753,10 +750,8 @@ bool ResolveExpression::visit(CallAST *ast) foreach (const LookupItem &r, b->find(functionCallOp)) { Symbol *overload = r.declaration(); if (Function *funTy = overload->type()->asFunctionType()) { - if (maybeValidPrototype(funTy, actualArgumentCount)) { - if (Function *proto = instantiate(namedTy->name(), funTy)->asFunctionType()) - addResult(proto->returnType().simplified(), scope); - } + if (maybeValidPrototype(funTy, actualArgumentCount)) + addResult(funTy->returnType().simplified(), scope); } } } @@ -806,9 +801,8 @@ bool ResolveExpression::visit(ArrayAccessAST *ast) foreach (const LookupItem &r, b->find(arrayAccessOp)) { Symbol *overload = r.declaration(); if (Function *funTy = overload->type()->asFunctionType()) { - if (Function *proto = instantiate(namedTy->name(), funTy)->asFunctionType()) - // ### TODO: check the actual arguments - addResult(proto->returnType().simplified(), scope); + // ### TODO: check the actual arguments + addResult(funTy->returnType().simplified(), scope); } } @@ -967,14 +961,8 @@ ClassOrNamespace *ResolveExpression::baseExpression(const QList<LookupItem> &bas continue; Scope *functionScope = overload->enclosingScope(); - if (overload->type()->isFunctionType()) { - FullySpecifiedType overloadTy - = instantiate(binding->templateId(), overload); - Function *instantiatedFunction = overloadTy->asFunctionType(); - Q_ASSERT(instantiatedFunction != 0); - - FullySpecifiedType retTy - = instantiatedFunction->returnType().simplified(); + if (Function *funTy = overload->type()->asFunctionType()) { + FullySpecifiedType retTy = funTy->returnType().simplified(); typeResolver.resolve(&retTy, &functionScope, r.binding()); @@ -1052,12 +1040,6 @@ ClassOrNamespace *ResolveExpression::findClassForTemplateParameterInExpressionSc return 0; } -FullySpecifiedType ResolveExpression::instantiate(const Name *className, Symbol *candidate) const -{ - return DeprecatedGenTemplateInstance::instantiate(className, candidate, - _context.bindings()->control()); -} - bool ResolveExpression::visit(PostIncrDecrAST *ast) { const QList<LookupItem> baseResults = resolve(ast->base_expression, _scope); |