diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2012-06-21 00:28:14 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2012-06-21 00:28:14 +0000 |
commit | 7bedfda4897d8804f0e4eb150635d274d67d969f (patch) | |
tree | 1b22755073caccf7dd886c5ccb7c6fbb187bd5fe /clang/lib/AST/RawCommentList.cpp | |
parent | 58713de545ab8673a64551f9dfe6f683ed0cdbae (diff) | |
download | bcm5719-llvm-7bedfda4897d8804f0e4eb150635d274d67d969f.tar.gz bcm5719-llvm-7bedfda4897d8804f0e4eb150635d274d67d969f.zip |
RawCommentList::addComment: fix the assertion so it actually checks that new comment is after the last one (change Comments[0] to Comments.back()), and handle the case of two consecutive comments, e.g. /** *//* */. There is already a testcase for that (but it didn't trigger the assert because the assert itself was wrong).
llvm-svn: 158882
Diffstat (limited to 'clang/lib/AST/RawCommentList.cpp')
-rw-r--r-- | clang/lib/AST/RawCommentList.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/AST/RawCommentList.cpp b/clang/lib/AST/RawCommentList.cpp index 06510294e77..1baa9b87eb1 100644 --- a/clang/lib/AST/RawCommentList.cpp +++ b/clang/lib/AST/RawCommentList.cpp @@ -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"); |