Skip to content

Commit ee88c0c

Browse files
committed
[NFCI] Fix unused variable/function warnings in MacroCallReconstructorTest.cpp when asserts are disabled.
1 parent a3cbb15 commit ee88c0c

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

clang/unittests/Format/MacroCallReconstructorTest.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,6 @@ struct Chunk {
9191
llvm::SmallVector<UnwrappedLine, 0> Children;
9292
};
9393

94-
bool tokenMatches(const FormatToken *Left, const FormatToken *Right) {
95-
if (Left->getType() == Right->getType() &&
96-
Left->TokenText == Right->TokenText)
97-
return true;
98-
llvm::dbgs() << Left->TokenText << " != " << Right->TokenText << "\n";
99-
return false;
100-
}
101-
10294
// Allows to produce chunks of a token list by typing the code of equal tokens.
10395
//
10496
// Created from a list of tokens, users call "consume" to get the next chunk
@@ -110,7 +102,9 @@ struct Matcher {
110102
Chunk consume(StringRef Tokens) {
111103
TokenList Result;
112104
for (const FormatToken *Token : uneof(Lex.lex(Tokens))) {
113-
assert(tokenMatches(*It, Token));
105+
(void)Token; // Fix unused variable warning when asserts are disabled.
106+
assert((*It)->getType() == Token->getType() &&
107+
(*It)->TokenText == Token->TokenText);
114108
Result.push_back(*It);
115109
++It;
116110
}

0 commit comments

Comments
 (0)