This should've been forwards from rbegin(), reverse iterators are just
too confusing to be used by mere mortals. Fixes out-of-bounds walks over
the list.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265934
91177308-0d34-0410-b5e6-
96231b3b80d8
if (PreviousMustBeValue && Line && Line->Tokens.size() > 1) {
// If the token before the previous one is an '@', the previous token is an
// annotation and can precede another identifier/value.
- const FormatToken *PrePrevious = std::next(Line->Tokens.rend(), 2)->Tok;
+ const FormatToken *PrePrevious = std::prev(Line->Tokens.end(), 2)->Tok;
if (PrePrevious->is(tok::at))
return;
}