Commit 64e9f652 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Handle using declarations

parent 9cde6bae
......@@ -794,6 +794,21 @@ bool CreateBindings::visit(BaseClass *b)
return false;
}
bool CreateBindings::visit(UsingDeclaration *u)
{
if (u->name()) {
if (const QualifiedNameId *q = u->name()->asQualifiedNameId()) {
if (const NameId *unqualifiedId = q->unqualifiedNameId()->asNameId()) {
if (ClassOrNamespace *delegate = _currentClassOrNamespace->lookupType(q)) {
ClassOrNamespace *b = _currentClassOrNamespace->findOrCreateType(unqualifiedId);
b->addUsing(delegate);
}
}
}
}
return false;
}
bool CreateBindings::visit(UsingNamespaceDirective *u)
{
if (ClassOrNamespace *e = _currentClassOrNamespace->lookupType(u->name())) {
......
......@@ -170,6 +170,7 @@ protected:
virtual bool visit(Function *);
virtual bool visit(BaseClass *b);
virtual bool visit(UsingNamespaceDirective *u);
virtual bool visit(UsingDeclaration *u);
virtual bool visit(NamespaceAlias *a);
virtual bool visit(ObjCClass *klass);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment