forked from qt-creator/qt-creator
C++: Fix code compl. for instantiation of template specialization
It works for full specialization. Instantiate of the partial specialization has to be implemented(finding appropriate partial specialization-on going) Added unit test. Change-Id: I8ef5ea963e7c665e0d67d390b3a833486773dab0 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
8
src/libs/3rdparty/cplusplus/Bind.cpp
vendored
8
src/libs/3rdparty/cplusplus/Bind.cpp
vendored
@@ -2639,10 +2639,14 @@ bool Bind::visit(TemplateIdAST *ast)
|
||||
}
|
||||
|
||||
const Identifier *id = identifier(ast->identifier_token);
|
||||
const int tokenKindBeforeIdentifier(translationUnit()->tokenKind(ast->identifier_token - 1));
|
||||
const bool isSpecialization = (tokenKindBeforeIdentifier == T_CLASS ||
|
||||
tokenKindBeforeIdentifier == T_STRUCT);
|
||||
if (templateArguments.empty())
|
||||
_name = control()->templateNameId(id);
|
||||
_name = control()->templateNameId(id, isSpecialization);
|
||||
else
|
||||
_name = control()->templateNameId(id, &templateArguments[0], templateArguments.size());
|
||||
_name = control()->templateNameId(id, isSpecialization, &templateArguments[0],
|
||||
templateArguments.size());
|
||||
|
||||
ast->name = _name;
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user