Commit 354b9712 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Merged ScopedSymbol and Scope.

parent 5accc966
...@@ -76,13 +76,13 @@ public: ...@@ -76,13 +76,13 @@ public:
} }
protected: protected:
bool process(ScopedSymbol *symbol) bool process(Scope *symbol)
{ {
if (! _scope) { if (! _scope) {
Scope *scope = symbol->members(); Scope *scope = symbol;
for (unsigned i = 0; i < scope->symbolCount(); ++i) { for (unsigned i = 0; i < scope->memberCount(); ++i) {
accept(scope->symbolAt(i)); accept(scope->memberAt(i));
if (_scope) if (_scope)
return false; return false;
...@@ -388,14 +388,6 @@ Symbol *Document::globalSymbolAt(unsigned index) const ...@@ -388,14 +388,6 @@ Symbol *Document::globalSymbolAt(unsigned index) const
return _globalNamespace->memberAt(index); return _globalNamespace->memberAt(index);
} }
Scope *Document::globalSymbols() const
{
if (! _globalNamespace)
return 0;
return _globalNamespace->members();
}
Namespace *Document::globalNamespace() const Namespace *Document::globalNamespace() const
{ {
return _globalNamespace; return _globalNamespace;
...@@ -411,20 +403,20 @@ Scope *Document::scopeAt(unsigned line, unsigned column) ...@@ -411,20 +403,20 @@ Scope *Document::scopeAt(unsigned line, unsigned column)
FindScopeAt findScopeAt(_translationUnit, line, column); FindScopeAt findScopeAt(_translationUnit, line, column);
if (Scope *scope = findScopeAt(_globalNamespace)) if (Scope *scope = findScopeAt(_globalNamespace))
return scope; return scope;
return globalSymbols(); return globalNamespace();
} }
Symbol *Document::lastVisibleSymbolAt(unsigned line, unsigned column) const Symbol *Document::lastVisibleSymbolAt(unsigned line, unsigned column) const
{ {
return lastVisibleSymbolAt(line, column, globalSymbols()); return lastVisibleSymbolAt(line, column, globalNamespace());
} }
Symbol *Document::lastVisibleSymbolAt(unsigned line, unsigned column, Scope *scope) const Symbol *Document::lastVisibleSymbolAt(unsigned line, unsigned column, Scope *scope) const
{ {
Symbol *previousSymbol = 0; Symbol *previousSymbol = 0;
for (unsigned i = 0; i < scope->symbolCount(); ++i) { for (unsigned i = 0; i < scope->memberCount(); ++i) {
Symbol *symbol = scope->symbolAt(i); Symbol *symbol = scope->memberAt(i);
if (symbol->line() > line) if (symbol->line() > line)
break; break;
...@@ -432,8 +424,8 @@ Symbol *Document::lastVisibleSymbolAt(unsigned line, unsigned column, Scope *sco ...@@ -432,8 +424,8 @@ Symbol *Document::lastVisibleSymbolAt(unsigned line, unsigned column, Scope *sco
} }
if (previousSymbol) { if (previousSymbol) {
if (ScopedSymbol *scoped = previousSymbol->asScopedSymbol()) { if (Scope *scope = previousSymbol->asScope()) {
if (Symbol *member = lastVisibleSymbolAt(line, column, scoped->members())) if (Symbol *member = lastVisibleSymbolAt(line, column, scope))
return member; return member;
} }
} }
...@@ -558,7 +550,7 @@ void Document::check(CheckMode mode) ...@@ -558,7 +550,7 @@ void Document::check(CheckMode mode)
semantic.setSkipFunctionBodies(true); semantic.setSkipFunctionBodies(true);
_globalNamespace = _control->newNamespace(0); _globalNamespace = _control->newNamespace(0);
Scope *globals = _globalNamespace->members(); Scope *globals = _globalNamespace;
if (! _translationUnit->ast()) if (! _translationUnit->ast())
return; // nothing to do. return; // nothing to do.
......
...@@ -84,7 +84,6 @@ public: ...@@ -84,7 +84,6 @@ public:
unsigned globalSymbolCount() const; unsigned globalSymbolCount() const;
Symbol *globalSymbolAt(unsigned index) const; Symbol *globalSymbolAt(unsigned index) const;
Scope *globalSymbols() const; // ### deprecate?
Namespace *globalNamespace() const; Namespace *globalNamespace() const;
void setGlobalNamespace(Namespace *globalNamespace); // ### internal void setGlobalNamespace(Namespace *globalNamespace); // ### internal
......
...@@ -401,7 +401,7 @@ FullySpecifiedType DeprecatedGenTemplateInstance::instantiate(const Name *classN ...@@ -401,7 +401,7 @@ FullySpecifiedType DeprecatedGenTemplateInstance::instantiate(const Name *classN
{ {
if (className) { if (className) {
if (const TemplateNameId *templId = className->asTemplateNameId()) { if (const TemplateNameId *templId = className->asTemplateNameId()) {
if (Class *klass = candidate->enclosingSymbol()->asClass()) { if (Class *klass = candidate->scope()->asClass()) {
DeprecatedGenTemplateInstance::Substitution subst; DeprecatedGenTemplateInstance::Substitution subst;
for (unsigned i = 0; i < templId->templateArgumentCount(); ++i) { for (unsigned i = 0; i < templId->templateArgumentCount(); ++i) {
......
...@@ -209,7 +209,7 @@ bool FindUsages::checkCandidates(const QList<LookupItem> &candidates) const ...@@ -209,7 +209,7 @@ bool FindUsages::checkCandidates(const QList<LookupItem> &candidates) const
const LookupItem &r = candidates.at(i); const LookupItem &r = candidates.at(i);
if (Symbol *s = r.declaration()) { if (Symbol *s = r.declaration()) {
if (_declSymbol->scope() && (_declSymbol->scope()->isPrototypeScope() || _declSymbol->scope()->isBlockScope())) { if (_declSymbol->scope() && (_declSymbol->scope()->isFunction() || _declSymbol->scope()->isBlock())) {
if (s->scope() != _declSymbol->scope()) if (s->scope() != _declSymbol->scope())
return false; return false;
...@@ -240,19 +240,12 @@ void FindUsages::checkExpression(unsigned startToken, unsigned endToken, Scope * ...@@ -240,19 +240,12 @@ void FindUsages::checkExpression(unsigned startToken, unsigned endToken, Scope *
reportResult(endToken, results); reportResult(endToken, results);
} }
Scope *FindUsages::switchScope(ScopedSymbol *symbol)
{
if (! symbol)
return _currentScope; // ### assert?
return switchScope(symbol->members());
}
Scope *FindUsages::switchScope(Scope *scope) Scope *FindUsages::switchScope(Scope *scope)
{ {
Scope *previousScope = _currentScope; if (! scope)
_currentScope = scope; return _currentScope;
return previousScope;
return switchScope(scope);
} }
void FindUsages::statement(StatementAST *ast) void FindUsages::statement(StatementAST *ast)
...@@ -345,7 +338,7 @@ bool FindUsages::visit(DeclaratorAST *ast) ...@@ -345,7 +338,7 @@ bool FindUsages::visit(DeclaratorAST *ast)
return false; return false;
} }
void FindUsages::declarator(DeclaratorAST *ast, ScopedSymbol *symbol) void FindUsages::declarator(DeclaratorAST *ast, Scope *symbol)
{ {
if (! ast) if (! ast)
return; return;
...@@ -493,13 +486,13 @@ void FindUsages::memInitializer(MemInitializerAST *ast) ...@@ -493,13 +486,13 @@ void FindUsages::memInitializer(MemInitializerAST *ast)
if (! ast) if (! ast)
return; return;
if (_currentScope->isPrototypeScope()) { if (_currentScope->isFunction()) {
Scope *classScope = _currentScope->enclosingClassScope(); Class *classScope = _currentScope->enclosingClass();
if (! classScope) { if (! classScope) {
if (ClassOrNamespace *binding = _context.lookupType(_currentScope->owner())) { if (ClassOrNamespace *binding = _context.lookupType(_currentScope)) {
foreach (Symbol *s, binding->symbols()) { foreach (Symbol *s, binding->symbols()) {
if (Class *k = s->asClass()) { if (Class *k = s->asClass()) {
classScope = k->members(); classScope = k;
break; break;
} }
} }
...@@ -658,7 +651,7 @@ void FindUsages::translationUnit(TranslationUnitAST *ast) ...@@ -658,7 +651,7 @@ void FindUsages::translationUnit(TranslationUnitAST *ast)
if (! ast) if (! ast)
return; return;
Scope *previousScope = switchScope(_doc->globalSymbols()); Scope *previousScope = switchScope(_doc->globalNamespace());
for (DeclarationListAST *it = ast->declaration_list; it; it = it->next) { for (DeclarationListAST *it = ast->declaration_list; it; it = it->next) {
this->declaration(it->value); this->declaration(it->value);
} }
......
...@@ -71,7 +71,6 @@ protected: ...@@ -71,7 +71,6 @@ protected:
using ASTVisitor::translationUnit; using ASTVisitor::translationUnit;
Scope *switchScope(Scope *scope); Scope *switchScope(Scope *scope);
Scope *switchScope(ScopedSymbol *symbol);
QString matchingLine(const Token &tk) const; QString matchingLine(const Token &tk) const;
...@@ -97,7 +96,7 @@ protected: ...@@ -97,7 +96,7 @@ protected:
void objCSelectorArgument(ObjCSelectorArgumentAST *ast); void objCSelectorArgument(ObjCSelectorArgumentAST *ast);
void attribute(AttributeAST *ast); void attribute(AttributeAST *ast);
void declarator(DeclaratorAST *ast, ScopedSymbol *symbol = 0); void declarator(DeclaratorAST *ast, Scope *symbol = 0);
void qtPropertyDeclarationItem(QtPropertyDeclarationItemAST *ast); void qtPropertyDeclarationItem(QtPropertyDeclarationItemAST *ast);
void qtInterfaceName(QtInterfaceNameAST *ast); void qtInterfaceName(QtInterfaceNameAST *ast);
void baseSpecifier(BaseSpecifierAST *ast); void baseSpecifier(BaseSpecifierAST *ast);
......
...@@ -99,7 +99,7 @@ Icons::IconType Icons::iconTypeForSymbol(const Symbol *symbol) ...@@ -99,7 +99,7 @@ Icons::IconType Icons::iconTypeForSymbol(const Symbol *symbol)
} else if (symbol->isPrivate()) { } else if (symbol->isPrivate()) {
return FuncPrivateIconType; return FuncPrivateIconType;
} }
} else if (symbol->scope() && symbol->scope()->isEnumScope()) { } else if (symbol->scope() && symbol->scope()->isEnum()) {
return EnumeratorIconType; return EnumeratorIconType;
} else if (symbol->isDeclaration() || symbol->isArgument()) { } else if (symbol->isDeclaration() || symbol->isArgument()) {
if (symbol->isPublic()) { if (symbol->isPublic()) {
......
...@@ -68,7 +68,7 @@ static void path_helper(Symbol *symbol, QList<const Name *> *names) ...@@ -68,7 +68,7 @@ static void path_helper(Symbol *symbol, QList<const Name *> *names)
if (! symbol) if (! symbol)
return; return;
path_helper(symbol->enclosingSymbol(), names); path_helper(symbol->scope(), names);
if (symbol->name()) { if (symbol->name()) {
if (symbol->isClass() || symbol->isNamespace()) { if (symbol->isClass() || symbol->isNamespace()) {
...@@ -142,7 +142,7 @@ LookupContext &LookupContext::operator = (const LookupContext &other) ...@@ -142,7 +142,7 @@ LookupContext &LookupContext::operator = (const LookupContext &other)
QList<const Name *> LookupContext::fullyQualifiedName(Symbol *symbol) QList<const Name *> LookupContext::fullyQualifiedName(Symbol *symbol)
{ {
QList<const Name *> qualifiedName = path(symbol->enclosingSymbol()); QList<const Name *> qualifiedName = path(symbol->scope());
addNames(symbol->name(), &qualifiedName, /*add all names*/ true); addNames(symbol->name(), &qualifiedName, /*add all names*/ true);
return qualifiedName; return qualifiedName;
} }
...@@ -238,7 +238,7 @@ ClassOrNamespace *LookupContext::globalNamespace() const ...@@ -238,7 +238,7 @@ ClassOrNamespace *LookupContext::globalNamespace() const
ClassOrNamespace *LookupContext::lookupType(const Name *name, Scope *scope) const ClassOrNamespace *LookupContext::lookupType(const Name *name, Scope *scope) const
{ {
if (ClassOrNamespace *b = bindings()->lookupType(scope->owner())) if (ClassOrNamespace *b = bindings()->lookupType(scope))
return b->lookupType(name); return b->lookupType(name);
return 0; return 0;
...@@ -256,18 +256,18 @@ QList<LookupItem> LookupContext::lookup(const Name *name, Scope *scope) const ...@@ -256,18 +256,18 @@ QList<LookupItem> LookupContext::lookup(const Name *name, Scope *scope) const
if (! name) if (! name)
return candidates; return candidates;
for (; scope; scope = scope->enclosingScope()) { for (; scope; scope = scope->scope()) {
if ((name->isNameId() || name->isTemplateNameId()) && scope->isBlockScope()) { if ((name->isNameId() || name->isTemplateNameId()) && scope->isBlock()) {
bindings()->lookupInScope(name, scope, &candidates, /*templateId = */ 0, /*binding=*/ 0); bindings()->lookupInScope(name, scope, &candidates, /*templateId = */ 0, /*binding=*/ 0);
if (! candidates.isEmpty()) if (! candidates.isEmpty())
break; // it's a local. break; // it's a local.
for (unsigned index = 0; index < scope->symbolCount(); ++index) { for (unsigned index = 0; index < scope->memberCount(); ++index) {
Symbol *member = scope->symbolAt(index); Symbol *member = scope->memberAt(index);
if (UsingNamespaceDirective *u = member->asUsingNamespaceDirective()) { if (UsingNamespaceDirective *u = member->asUsingNamespaceDirective()) {
if (Namespace *enclosingNamespace = u->enclosingNamespaceScope()->owner()->asNamespace()) { if (Namespace *enclosingNamespace = u->enclosingNamespace()->asNamespace()) {
if (ClassOrNamespace *b = bindings()->lookupType(enclosingNamespace)) { if (ClassOrNamespace *b = bindings()->lookupType(enclosingNamespace)) {
if (ClassOrNamespace *uu = b->lookupType(u->name())) { if (ClassOrNamespace *uu = b->lookupType(u->name())) {
candidates = uu->find(name); candidates = uu->find(name);
...@@ -280,9 +280,8 @@ QList<LookupItem> LookupContext::lookup(const Name *name, Scope *scope) const ...@@ -280,9 +280,8 @@ QList<LookupItem> LookupContext::lookup(const Name *name, Scope *scope) const
} }
} }
} else if (scope->isPrototypeScope()) { } else if (Function *fun = scope->asFunction()) {
Function *fun = scope->owner()->asFunction(); bindings()->lookupInScope(name, fun, &candidates, /*templateId = */ 0, /*binding=*/ 0);
bindings()->lookupInScope(name, fun->members(), &candidates, /*templateId = */ 0, /*binding=*/ 0);
for (TemplateParameters *it = fun->templateParameters(); it && candidates.isEmpty(); it = it->previous()) for (TemplateParameters *it = fun->templateParameters(); it && candidates.isEmpty(); it = it->previous())
bindings()->lookupInScope(name, it->scope(), &candidates, /* templateId = */ 0, /*binding=*/ 0); bindings()->lookupInScope(name, it->scope(), &candidates, /* templateId = */ 0, /*binding=*/ 0);
...@@ -301,16 +300,13 @@ QList<LookupItem> LookupContext::lookup(const Name *name, Scope *scope) const ...@@ -301,16 +300,13 @@ QList<LookupItem> LookupContext::lookup(const Name *name, Scope *scope) const
// contunue, and look at the enclosing scope. // contunue, and look at the enclosing scope.
} else if (scope->isObjCMethodScope()) { } else if (ObjCMethod *method = scope->asObjCMethod()) {
ObjCMethod *method = scope->owner()->asObjCMethod(); bindings()->lookupInScope(name, method, &candidates, /*templateId = */ 0, /*binding=*/ 0);
bindings()->lookupInScope(name, method->arguments(), &candidates, /*templateId = */ 0, /*binding=*/ 0);
if (! candidates.isEmpty()) if (! candidates.isEmpty())
break; // it's a formal argument. break; // it's a formal argument.
} else if (scope->isClassScope()) { } else if (Class *klass = scope->asClass()) {
Class *klass = scope->owner()->asClass();
for (TemplateParameters *it = klass->templateParameters(); it && candidates.isEmpty(); it = it->previous()) for (TemplateParameters *it = klass->templateParameters(); it && candidates.isEmpty(); it = it->previous())
bindings()->lookupInScope(name, it->scope(), &candidates, /* templateId = */ 0, /*binding=*/ 0); bindings()->lookupInScope(name, it->scope(), &candidates, /* templateId = */ 0, /*binding=*/ 0);
...@@ -324,15 +320,15 @@ QList<LookupItem> LookupContext::lookup(const Name *name, Scope *scope) const ...@@ -324,15 +320,15 @@ QList<LookupItem> LookupContext::lookup(const Name *name, Scope *scope) const
return candidates; return candidates;
} }
} else if (scope->isNamespaceScope()) { } else if (Namespace *ns = scope->asNamespace()) {
if (ClassOrNamespace *binding = bindings()->lookupType(scope->owner())) if (ClassOrNamespace *binding = bindings()->lookupType(ns))
candidates = binding->find(name); candidates = binding->find(name);
if (! candidates.isEmpty()) if (! candidates.isEmpty())
return candidates; return candidates;
} else if (scope->isObjCClassScope() || scope->isObjCProtocolScope()) { } else if (scope->isObjCClass() || scope->isObjCProtocol()) {
if (ClassOrNamespace *binding = bindings()->lookupType(scope->owner())) if (ClassOrNamespace *binding = bindings()->lookupType(scope))
candidates = binding->find(name); candidates = binding->find(name);
if (! candidates.isEmpty()) if (! candidates.isEmpty())
...@@ -456,8 +452,8 @@ void ClassOrNamespace::lookup_helper(const Name *name, ClassOrNamespace *binding ...@@ -456,8 +452,8 @@ void ClassOrNamespace::lookup_helper(const Name *name, ClassOrNamespace *binding
if (s->isFriend()) if (s->isFriend())
continue; continue;
if (ScopedSymbol *scoped = s->asScopedSymbol()) { if (Scope *scope = s->asScope()) {
if (Class *klass = scoped->asClass()) { if (Class *klass = scope->asClass()) {
if (const Identifier *id = klass->identifier()) { if (const Identifier *id = klass->identifier()) {
if (nameId && nameId->isEqualTo(id)) { if (nameId && nameId->isEqualTo(id)) {
LookupItem item; LookupItem item;
...@@ -467,12 +463,12 @@ void ClassOrNamespace::lookup_helper(const Name *name, ClassOrNamespace *binding ...@@ -467,12 +463,12 @@ void ClassOrNamespace::lookup_helper(const Name *name, ClassOrNamespace *binding
} }
} }
} }
_factory->lookupInScope(name, scoped->members(), result, templateId, binding); _factory->lookupInScope(name, scope, result, templateId, binding);
} }
} }
foreach (Enum *e, binding->enums()) foreach (Enum *e, binding->enums())
_factory->lookupInScope(name, e->members(), result, templateId, binding); _factory->lookupInScope(name, e, result, templateId, binding);
foreach (ClassOrNamespace *u, binding->usings()) foreach (ClassOrNamespace *u, binding->usings())
lookup_helper(name, u, result, processed, binding->_templateId); lookup_helper(name, u, result, processed, binding->_templateId);
...@@ -490,7 +486,7 @@ void CreateBindings::lookupInScope(const Name *name, Scope *scope, ...@@ -490,7 +486,7 @@ void CreateBindings::lookupInScope(const Name *name, Scope *scope,
return; return;
} else if (const OperatorNameId *op = name->asOperatorNameId()) { } else if (const OperatorNameId *op = name->asOperatorNameId()) {
for (Symbol *s = scope->lookat(op->kind()); s; s = s->next()) { for (Symbol *s = scope->find(op->kind()); s; s = s->next()) {
if (! s->name()) if (! s->name())
continue; continue;
else if (s->isFriend()) else if (s->isFriend())
...@@ -505,7 +501,7 @@ void CreateBindings::lookupInScope(const Name *name, Scope *scope, ...@@ -505,7 +501,7 @@ void CreateBindings::lookupInScope(const Name *name, Scope *scope,
} }
} else if (const Identifier *id = name->identifier()) { } else if (const Identifier *id = name->identifier()) {
for (Symbol *s = scope->lookat(id); s; s = s->next()) { for (Symbol *s = scope->find(id); s; s = s->next()) {
if (s->isFriend()) if (s->isFriend())
continue; // skip friends continue; // skip friends
else if (! id->isEqualTo(s->identifier())) else if (! id->isEqualTo(s->identifier()))
......
...@@ -79,13 +79,9 @@ QModelIndex OverviewModel::index(int row, int column, const QModelIndex &parent) ...@@ -79,13 +79,9 @@ QModelIndex OverviewModel::index(int row, int column, const QModelIndex &parent)
Symbol *parentSymbol = static_cast<Symbol *>(parent.internalPointer()); Symbol *parentSymbol = static_cast<Symbol *>(parent.internalPointer());
Q_ASSERT(parentSymbol); Q_ASSERT(parentSymbol);
ScopedSymbol *scopedSymbol = parentSymbol->asScopedSymbol(); Scope *scope = parentSymbol->asScope();
Q_ASSERT(scopedSymbol); Q_ASSERT(scope != 0);
return createIndex(row, 0, scope->memberAt(row));
Scope *scope = scopedSymbol->members();
Q_ASSERT(scope);
return createIndex(row, 0, scope->symbolAt(row));
} }
} }
...@@ -96,14 +92,12 @@ QModelIndex OverviewModel::parent(const QModelIndex &child) const ...@@ -96,14 +92,12 @@ QModelIndex OverviewModel::parent(const QModelIndex &child) const
return QModelIndex(); return QModelIndex();
if (Scope *scope = symbol->scope()) { if (Scope *scope = symbol->scope()) {
Symbol *parentSymbol = scope->owner(); if (scope->scope()) {
if (parentSymbol && parentSymbol->scope()) {
QModelIndex index; QModelIndex index;
if (parentSymbol->scope() && parentSymbol->scope()->owner() if (scope->scope() && scope->scope()->scope()) // the parent doesn't have a parent
&& parentSymbol->scope()->owner()->scope()) // the parent doesn't have a parent index = createIndex(scope->index(), 0, scope);
index = createIndex(parentSymbol->index(), 0, parentSymbol);
else //+1 to account for no symbol item else //+1 to account for no symbol item
index = createIndex(parentSymbol->index() + 1, 0, parentSymbol); index = createIndex(scope->index() + 1, 0, scope);
return index; return index;
} }
} }
...@@ -122,12 +116,9 @@ int OverviewModel::rowCount(const QModelIndex &parent) const ...@@ -122,12 +116,9 @@ int OverviewModel::rowCount(const QModelIndex &parent) const
Symbol *parentSymbol = static_cast<Symbol *>(parent.internalPointer()); Symbol *parentSymbol = static_cast<Symbol *>(parent.internalPointer());
Q_ASSERT(parentSymbol); Q_ASSERT(parentSymbol);
if (ScopedSymbol *scopedSymbol = parentSymbol->asScopedSymbol()) { if (Scope *parentScope = parentSymbol->asScope()) {
if (!scopedSymbol->isFunction() && !scopedSymbol->isObjCMethod()) { if (!parentScope->isFunction() && !parentScope->isObjCMethod()) {
Scope *parentScope = scopedSymbol->members(); return parentScope->memberCount();
Q_ASSERT(parentScope);
return parentScope->symbolCount();
} }
} }
return 0; return 0;
......
...@@ -88,7 +88,8 @@ QList<LookupItem> ResolveExpression::operator()(ExpressionAST *ast, Scope *scope ...@@ -88,7 +88,8 @@ QList<LookupItem> ResolveExpression::operator()(ExpressionAST *ast, Scope *scope
QList<LookupItem> ResolveExpression::resolve(ExpressionAST *ast, Scope *scope) QList<LookupItem> ResolveExpression::resolve(ExpressionAST *ast, Scope *scope)
{ {
Q_ASSERT(scope != 0); if (! scope)
return QList<LookupItem>();
Scope *previousVisibleSymbol = _scope; Scope *previousVisibleSymbol = _scope;
_scope = scope; _scope = scope;
...@@ -174,7 +175,7 @@ bool ResolveExpression::visit(BinaryExpressionAST *ast) ...@@ -174,7 +175,7 @@ bool ResolveExpression::visit(BinaryExpressionAST *ast)
bool ResolveExpression::visit(CastExpressionAST *ast) bool ResolveExpression::visit(CastExpressionAST *ast)
{ {
Scope *dummyScope = _context.expressionDocument()->globalSymbols(); Scope *dummyScope = _context.expressionDocument()->globalNamespace();
FullySpecifiedType ty = sem.check(ast->type_id, dummyScope); FullySpecifiedType ty = sem.check(ast->type_id, dummyScope);
addResult(ty, _scope); addResult(ty, _scope);
return false; return false;
...@@ -199,7 +200,7 @@ bool ResolveExpression::visit(ConditionalExpressionAST *ast) ...@@ -199,7 +200,7 @@ bool ResolveExpression::visit(ConditionalExpressionAST *ast)
bool ResolveExpression::visit(CppCastExpressionAST *ast) bool ResolveExpression::visit(CppCastExpressionAST *ast)
{ {
Scope *dummyScope = _context.expressionDocument()->globalSymbols();