]> granicus.if.org Git - clang/commitdiff
Modify the assumptions of an assert; the updated latest redeclaration can have the...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 20 Oct 2010 23:48:40 +0000 (23:48 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 20 Oct 2010 23:48:40 +0000 (23:48 +0000)
if it's a template specialization pointing at the template.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116974 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Serialization/ASTReaderDecl.cpp

index af7043b270822b6da6d6d4534e597e91a32d4590..119dbc39146edcd0d88b66173fac68fb9061ccd2 100644 (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));