Skip to content

Commit 486919f

Browse files
committed
Fix tests
1 parent 3bb8eb3 commit 486919f

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,14 @@ void UseUsingCheck::check(const MatchFinder::MatchResult &Result) {
8888
("using " + MatchedDecl.getName() + " =").str())
8989
<< FixItHint::CreateRemoval(RemovalRange);
9090

91-
Token FirstToken;
92-
Lexer::getRawToken(MatchedDecl.getBeginLoc(), FirstToken, SM, LO);
93-
if (FirstToken.getRawIdentifier() == "typedef")
94-
Diag << FixItHint::CreateRemoval(FirstToken.getLocation());
95-
96-
if (TokenBeforeName.getRawIdentifier() == "typedef")
91+
SmallString<128> Scratch;
92+
if (Lexer::getSpelling(MatchedDecl.getBeginLoc(), Scratch, SM, LO) ==
93+
"typedef")
94+
Diag << FixItHint::CreateRemoval(MatchedDecl.getBeginLoc());
95+
96+
Scratch.resize(0);
97+
if (Lexer::getSpelling(TokenBeforeName.getLocation(), Scratch, SM, LO) ==
98+
"typedef")
9799
Diag << FixItHint::CreateRemoval(TokenBeforeName.getLocation());
98100

99101
FirstTypedefName = MatchedDecl.getName();

0 commit comments

Comments
 (0)