diff --git a/clang/lib/Format/FormatToken.h b/clang/lib/Format/FormatToken.h index 6aaf66c7bb7e54..6b7d475232b0e1 100644 --- a/clang/lib/Format/FormatToken.h +++ b/clang/lib/Format/FormatToken.h @@ -693,7 +693,7 @@ struct FormatToken { } /// Returns the previous token ignoring comments. - FormatToken *getPreviousNonComment() const { + LLVM_NODISCARD FormatToken *getPreviousNonComment() const { FormatToken *Tok = Previous; while (Tok && Tok->is(tok::comment)) Tok = Tok->Previous;