forked from qt-creator/qt-creator
C++: disambiguate cast expressions for highlighting.
Task-number: QTCREATORBUG-5606 Change-Id: Iaea9f2afc57e2f22f734c43bd22105e19d768224 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
@@ -148,6 +148,23 @@ protected:
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool visit(CastExpressionAST *ast)
|
||||
{
|
||||
if (ast->expression && ast->expression->asUnaryExpression()) {
|
||||
TypeIdAST *typeId = ast->type_id->asTypeId();
|
||||
if (typeId && !typeId->declarator && typeId->type_specifier_list && !typeId->type_specifier_list->next) {
|
||||
if (NamedTypeSpecifierAST *namedTypeSpec = typeId->type_specifier_list->value->asNamedTypeSpecifier()) {
|
||||
if (checkLocalUse(namedTypeSpec->name, namedTypeSpec->firstToken())) {
|
||||
accept(ast->expression);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool visit(QtMemberDeclarationAST *ast)
|
||||
{
|
||||
if (tokenKind(ast->q_token) == T_Q_D)
|
||||
|
||||
Reference in New Issue
Block a user