forked from qt-creator/qt-creator
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:
committed by
Erik Verbruggen
parent
a2b2857b44
commit
080bf4ecb8
8
src/libs/3rdparty/cplusplus/Bind.cpp
vendored
8
src/libs/3rdparty/cplusplus/Bind.cpp
vendored
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user