Skip to content

Commit 295e4f4

Browse files
committed
Correct a comment and update a return type; NFC
These changes were inspired by a post-commit review comment: #97274 (review)
1 parent df0f313 commit 295e4f4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clang/include/clang/Lex/Preprocessor.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -2139,8 +2139,8 @@ class Preprocessor {
21392139
}
21402140

21412141
/// Given a Token \p Tok that is a numeric constant with length 1,
2142-
/// return the character.
2143-
char
2142+
/// return the value of constant as an unsigned 8-bit integer.
2143+
uint8_t
21442144
getSpellingOfSingleCharacterNumericConstant(const Token &Tok,
21452145
bool *Invalid = nullptr) const {
21462146
assert((Tok.is(tok::numeric_constant) || Tok.is(tok::binary_data)) &&

clang/lib/Sema/SemaExpr.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3652,7 +3652,7 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok, Scope *UDLScope) {
36523652
// Fast path for a single digit (which is quite common). A single digit
36533653
// cannot have a trigraph, escaped newline, radix prefix, or suffix.
36543654
if (Tok.getLength() == 1 || Tok.getKind() == tok::binary_data) {
3655-
const char Val = PP.getSpellingOfSingleCharacterNumericConstant(Tok);
3655+
const uint8_t Val = PP.getSpellingOfSingleCharacterNumericConstant(Tok);
36563656
return ActOnIntegerConstant(Tok.getLocation(), Val);
36573657
}
36583658

0 commit comments

Comments
 (0)