Merge remote branch 'origin/1.3'

This commit is contained in:
Roberto Raggi
2009-11-17 09:40:50 +01:00
4 changed files with 13 additions and 10 deletions

View File

@@ -442,6 +442,8 @@ bool Parser::parseTranslationUnit(TranslationUnitAST *&node)
rewind(start_declaration + 1);
skipUntilDeclaration();
}
_templateArgumentList.clear();
}
node = ast;
@@ -569,6 +571,8 @@ bool Parser::parseLinkageBody(DeclarationAST *&node)
rewind(start_declaration + 1);
skipUntilDeclaration();
}
_templateArgumentList.clear();
}
match(T_RBRACE, &ast->rbrace_token);
node = ast;
@@ -693,11 +697,9 @@ bool Parser::parseOperatorFunctionId(NameAST *&node)
Parser::TemplateArgumentListEntry *Parser::templateArgumentListEntry(unsigned tokenIndex)
{
for (unsigned i = 0; i < _templateArgumentList.size(); ++i) {
TemplateArgumentListEntry *entry = &_templateArgumentList[i];
if (entry->index == tokenIndex)
return entry;
}
std::map<unsigned, TemplateArgumentListEntry>::iterator it =_templateArgumentList.find(tokenIndex);
if (it != _templateArgumentList.end())
return &it->second;
return 0;
}
@@ -729,11 +731,11 @@ bool Parser::parseTemplateArgumentList(TemplateArgumentListAST *&node)
}
}
_templateArgumentList.push_back(TemplateArgumentListEntry(start, cursor(), node));
_templateArgumentList.insert(std::make_pair(cursor(), TemplateArgumentListEntry(start, cursor(), node)));
return true;
}
_templateArgumentList.push_back(TemplateArgumentListEntry(start, cursor(), 0));
_templateArgumentList.insert(std::make_pair(cursor(), TemplateArgumentListEntry(start, cursor(), 0)));
return false;
}