Index: clang/lib/AST/RawCommentList.cpp =================================================================== --- clang/lib/AST/RawCommentList.cpp +++ clang/lib/AST/RawCommentList.cpp @@ -431,7 +431,7 @@ }; auto DropTrailingNewLines = [](std::string &Str) { - while (Str.back() == '\n') + while (not Str.empty() and Str.back() == '\n') Str.pop_back(); };