summaryrefslogtreecommitdiff
path: root/clang/lib/AST/RawCommentList.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-05-22 16:12:18 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-05-22 16:12:18 +0000
commitec2b0f99f245da9ce98e41cf4cc2b6b2a02726f6 (patch)
tree774f987ba7db709a137b63ff7fb53b89b681f188 /clang/lib/AST/RawCommentList.cpp
parent4c8711804d577470fbe78eed165ac2de66b5653b (diff)
Notes
Diffstat (limited to 'clang/lib/AST/RawCommentList.cpp')
-rw-r--r--clang/lib/AST/RawCommentList.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/AST/RawCommentList.cpp b/clang/lib/AST/RawCommentList.cpp
index 83e8a0b942a4..d7124156521c 100644
--- a/clang/lib/AST/RawCommentList.cpp
+++ b/clang/lib/AST/RawCommentList.cpp
@@ -430,7 +430,7 @@ std::string RawComment::getFormattedText(const SourceManager &SourceMgr,
};
auto DropTrailingNewLines = [](std::string &Str) {
- while (Str.back() == '\n')
+ while (!Str.empty() && Str.back() == '\n')
Str.pop_back();
};