summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReaderDecl.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-10-20 23:48:40 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-10-20 23:48:40 +0000
commit54b88e72d012b2eaf8f0153693e94db3e58e15e1 (patch)
treee0fd2cbc44e61793dce7cb1352b4aaa5236aaacb /clang/lib/Serialization/ASTReaderDecl.cpp
parent982b32b1b681b1a2c13072fb8ab2b379ff040856 (diff)
downloadbcm5719-llvm-54b88e72d012b2eaf8f0153693e94db3e58e15e1.tar.gz
bcm5719-llvm-54b88e72d012b2eaf8f0153693e94db3e58e15e1.zip
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
Diffstat (limited to 'clang/lib/Serialization/ASTReaderDecl.cpp')
-rw-r--r--clang/lib/Serialization/ASTReaderDecl.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp
index af7043b2708..119dbc39146 100644
--- a/clang/lib/Serialization/ASTReaderDecl.cpp
+++ b/clang/lib/Serialization/ASTReaderDecl.cpp
@@ -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));
OpenPOWER on IntegriCloud