Modify the assumptions of an assert; the updated latest redeclaration can have the same location

if it's a template specialization pointing at the template.

llvm-svn: 116974
This commit is contained in:
Argyrios Kyrtzidis 2010-10-20 23:48:40 +00:00
parent 982b32b1b6
commit 54b88e72d0
1 changed files with 6 additions and 6 deletions

View File

@ -989,9 +989,9 @@ void ASTDeclReader::VisitRedeclarableTemplateDecl(RedeclarableTemplateDecl *D) {
Decl *NewLatest = Reader.GetDecl(I->second);
assert((LatestDecl->getLocation().isInvalid() ||
NewLatest->getLocation().isInvalid() ||
Reader.SourceMgr.isBeforeInTranslationUnit(
LatestDecl->getLocation(),
NewLatest->getLocation())) &&
!Reader.SourceMgr.isBeforeInTranslationUnit(
NewLatest->getLocation(),
LatestDecl->getLocation())) &&
"The new latest is supposed to come after the previous latest");
LatestDecl = cast<RedeclarableTemplateDecl>(NewLatest);
}
@ -1203,9 +1203,9 @@ void ASTDeclReader::VisitRedeclarable(Redeclarable<T> *D) {
Decl *NewLatest = Reader.GetDecl(I->second);
assert((D->getMostRecentDeclaration()->getLocation().isInvalid() ||
NewLatest->getLocation().isInvalid() ||
Reader.SourceMgr.isBeforeInTranslationUnit(
D->getMostRecentDeclaration()->getLocation(),
NewLatest->getLocation())) &&
!Reader.SourceMgr.isBeforeInTranslationUnit(
NewLatest->getLocation(),
D->getMostRecentDeclaration()->getLocation())) &&
"The new latest is supposed to come after the previous latest");
D->RedeclLink
= typename Redeclarable<T>::LatestDeclLink(cast_or_null<T>(NewLatest));