Skip to content

Commit eb48683

Browse files
committed
Extract source location to variable
1 parent 8556e25 commit eb48683

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

clang/lib/Lex/LiteralSupport.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,10 +1438,8 @@ void NumericLiteralParser::ParseNumberStartingWithZero(SourceLocation TokLoc) {
14381438
// Done
14391439
} else if ((isHexDigit(*s) && *s != 'e' && *s != 'E' && *s != '.') &&
14401440
!isValidUDSuffix(LangOpts, StringRef(s, ThisTokEnd - s))) {
1441-
Diags.Report(Lexer::AdvanceToTokenCharacter(TokLoc, s - ThisTokBegin, SM,
1442-
LangOpts),
1443-
diag::err_invalid_digit)
1444-
<< StringRef(s, 1) << 1;
1441+
auto InvalidDigitLoc = Lexer::AdvanceToTokenCharacter(TokLoc, s - ThisTokBegin, SM, LangOpts);
1442+
Diags.Report(InvalidDigitLoc, diag::err_invalid_digit) << StringRef(s, 1) << 1;
14451443
hadError = true;
14461444
}
14471445
// Other suffixes will be diagnosed by the caller.

0 commit comments

Comments
 (0)