diff options
author | Jorge Gorbe Moya <jgorbe@google.com> | 2022-07-13 02:46:07 +0300 |
---|---|---|
committer | Jorge Gorbe Moya <jgorbe@google.com> | 2022-07-13 02:46:58 +0300 |
commit | ee88c0cf09969ba44307068797e12533b94768a6 (patch) | |
tree | a830dc1070430d8e06030baa8b35f9a49219c2b1 /clang | |
parent | a3cbb158a277e62dfa19b3740012270b3cfd0a47 (diff) |
[NFCI] Fix unused variable/function warnings in MacroCallReconstructorTest.cpp when asserts are disabled.
Diffstat (limited to 'clang')
-rw-r--r-- | clang/unittests/Format/MacroCallReconstructorTest.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/clang/unittests/Format/MacroCallReconstructorTest.cpp b/clang/unittests/Format/MacroCallReconstructorTest.cpp index 2bda62aa42be..3abe0383aeae 100644 --- a/clang/unittests/Format/MacroCallReconstructorTest.cpp +++ b/clang/unittests/Format/MacroCallReconstructorTest.cpp @@ -91,14 +91,6 @@ struct Chunk { llvm::SmallVector<UnwrappedLine, 0> Children; }; -bool tokenMatches(const FormatToken *Left, const FormatToken *Right) { - if (Left->getType() == Right->getType() && - Left->TokenText == Right->TokenText) - return true; - llvm::dbgs() << Left->TokenText << " != " << Right->TokenText << "\n"; - return false; -} - // Allows to produce chunks of a token list by typing the code of equal tokens. // // Created from a list of tokens, users call "consume" to get the next chunk @@ -110,7 +102,9 @@ struct Matcher { Chunk consume(StringRef Tokens) { TokenList Result; for (const FormatToken *Token : uneof(Lex.lex(Tokens))) { - assert(tokenMatches(*It, Token)); + (void)Token; // Fix unused variable warning when asserts are disabled. + assert((*It)->getType() == Token->getType() && + (*It)->TokenText == Token->TokenText); Result.push_back(*It); ++It; } |