]> granicus.if.org Git - clang/commitdiff
RawCommentList::addComment: fix the assertion so it actually checks that new comment...
authorDmitri Gribenko <gribozavr@gmail.com>
Thu, 21 Jun 2012 00:28:14 +0000 (00:28 +0000)
committerDmitri Gribenko <gribozavr@gmail.com>
Thu, 21 Jun 2012 00:28:14 +0000 (00:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158882 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/RawCommentList.cpp

index 06510294e77f494798b148168bb2eb069eb1e901..1baa9b87eb166a728f0ba10e967c57c34bbbeae5 100644 (file)
@@ -159,8 +159,10 @@ void RawCommentList::addComment(const RawComment &RC) {
     return;
 
   assert((Comments.empty() ||
+          Comments.back().getSourceRange().getEnd() ==
+              RC.getSourceRange().getBegin() ||
           SourceMgr.isBeforeInTranslationUnit(
-              Comments[0].getSourceRange().getEnd(),
+              Comments.back().getSourceRange().getEnd(),
               RC.getSourceRange().getBegin())) &&
          "comments are not coming in source order");