[clang] 1c13bbd - [NFCI] Fix set-but-unused warning in UnwrappedLineParser.cpp

Dávid Bolvanský via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 24 00:13:45 PDT 2022


Author: Dávid Bolvanský
Date: 2022-03-24T08:13:29+01:00
New Revision: 1c13bbdde630b8716f817989a33ccc77a588642c

URL: https://github.com/llvm/llvm-project/commit/1c13bbdde630b8716f817989a33ccc77a588642c
DIFF: https://github.com/llvm/llvm-project/commit/1c13bbdde630b8716f817989a33ccc77a588642c.diff

LOG: [NFCI] Fix set-but-unused warning in UnwrappedLineParser.cpp

Added: 
    

Modified: 
    clang/lib/Format/UnwrappedLineParser.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index 8052eb932141d..b8cffcd471e91 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -600,10 +600,8 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) {
   do {
     // Get next non-comment token.
     FormatToken *NextTok;
-    unsigned ReadTokens = 0;
     do {
       NextTok = Tokens->getNextToken();
-      ++ReadTokens;
     } while (NextTok->is(tok::comment));
 
     switch (Tok->Tok.getKind()) {
@@ -643,7 +641,6 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) {
             ScopedMacroState MacroState(*Line, Tokens, NextTok);
             do {
               NextTok = Tokens->getNextToken();
-              ++ReadTokens;
             } while (NextTok->isNot(tok::eof));
           }
 
@@ -696,7 +693,6 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) {
             // We can have an array subscript after a braced init
             // list, but C++11 attributes are expected after blocks.
             NextTok = Tokens->getNextToken();
-            ++ReadTokens;
             ProbablyBracedList = NextTok->isNot(tok::l_square);
           }
         }


        


More information about the cfe-commits mailing list