forked from OSchip/llvm-project
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
This commit is contained in:
parent
58713de545
commit
7bedfda489
|
@ -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");
|
||||
|
||||
|
|
Loading…
Reference in New Issue