[clang] 48a31c8 - [clang-format] Mark FormatToken::getPreviousNonComment() nodiscard. NFC.

Marek Kurdej via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 16 13:57:43 PST 2022


Author: Marek Kurdej
Date: 2022-02-16T22:56:32+01:00
New Revision: 48a31c8f429022a07e2e35f3e62d5f495117f2e7

URL: https://github.com/llvm/llvm-project/commit/48a31c8f429022a07e2e35f3e62d5f495117f2e7
DIFF: https://github.com/llvm/llvm-project/commit/48a31c8f429022a07e2e35f3e62d5f495117f2e7.diff

LOG: [clang-format] Mark FormatToken::getPreviousNonComment() nodiscard. NFC.

Added: 
    

Modified: 
    clang/lib/Format/FormatToken.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/Format/FormatToken.h b/clang/lib/Format/FormatToken.h
index 6aaf66c7bb7e..6b7d475232b0 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;


        


More information about the cfe-commits mailing list