Resolve ambiguous C++-like initilized declarations.

This commit is contained in:
Roberto Raggi
2010-05-14 09:57:59 +02:00
parent 517e04ff60
commit 9ed1f667a8

View File

@@ -570,9 +570,8 @@ bool ResolveExpression::visit(MemberAccessAST *ast)
ClassOrNamespace *ResolveExpression::findClass(const FullySpecifiedType &originalTy, Scope *scope) const
{
ClassOrNamespace *binding = 0;
FullySpecifiedType ty = originalTy.simplified();
ClassOrNamespace *binding = 0;
if (Class *klass = ty->asClassType())
binding = _context.classOrNamespace(klass);
@@ -580,6 +579,9 @@ ClassOrNamespace *ResolveExpression::findClass(const FullySpecifiedType &origina
else if (NamedType *namedTy = ty->asNamedType())
binding = _context.classOrNamespace(namedTy->name(), scope);
else if (Function *funTy = ty->asFunctionType())
return findClass(funTy->returnType(), scope);
return binding;
}