Skip to content
Snippets Groups Projects
Commit c24bd7c4 authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

C++: disambiguate cast expressions for highlighting.


Task-number: QTCREATORBUG-5606
Change-Id: Iaea9f2afc57e2f22f734c43bd22105e19d768224
Reviewed-by: default avatarRoberto Raggi <roberto.raggi@nokia.com>
parent 36d70589
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment