C++: improve support for anonymous classes

Fix:
* highlighting
* find usages
* follow symbol
* code completion

Task-number: QTCREATORBUG-6497
Task-number: QTCREATORBUG-8963
Task-number: QTCREATORBUG-3610
Task-number: QTCREATORBUG-7579

Change-Id: I3dcaf1c515d0199c3e6bee72284fbb40064686ee
Reviewed-by: Petar Perisin <petar.perisin@gmail.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Przemyslaw Gorszkowski
2013-04-10 23:30:18 +02:00
committed by Erik Verbruggen
parent a2b2857b44
commit 080bf4ecb8
27 changed files with 341 additions and 7 deletions

View File

@@ -2614,6 +2614,12 @@ bool Bind::visit(ConversionFunctionIdAST *ast)
return false;
}
bool Bind::visit(AnonymousNameAST *ast)
{
ast->name = _name = control()->anonymousNameId(ast->class_token);
return false;
}
bool Bind::visit(SimpleNameAST *ast)
{
const Identifier *id = identifier(ast->identifier_token);
@@ -2896,7 +2902,7 @@ bool Bind::visit(ClassSpecifierAST *ast)
const Name *className = this->name(ast->name);
if (ast->name) {
if (ast->name && ! ast->name->asAnonymousName()) {
sourceLocation = location(ast->name, sourceLocation);
startScopeOffset = tokenAt(sourceLocation).end(); // at the end of the class name