================ @@ -3644,9 +3644,11 @@ bool Sema::CheckLoopHintExpr(Expr *E, SourceLocation Loc, bool AllowZero) { ExprResult Sema::ActOnNumericConstant(const Token &Tok, Scope *UDLScope) { // Fast path for a single digit (which is quite common). A single digit // cannot have a trigraph, escaped newline, radix prefix, or suffix. - if (Tok.getLength() == 1) { + if (Tok.getLength() == 1 || Tok.getKind() == tok::binary_data) { const char Val = PP.getSpellingOfSingleCharacterNumericConstant(Tok); - return ActOnIntegerConstant(Tok.getLocation(), Val-'0'); + return ActOnIntegerConstant( + Tok.getLocation(), + (Tok.getKind() == tok::binary_data) ? Val : Val - '0'); ---------------- cor3ntin wrote:
can we move that to PP.getSpellingOfSingleCharacterNumericConstant? https://github.com/llvm/llvm-project/pull/97274 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits