[clang] [Clang] Fixed an assertion caused by Microsoft integer literals exceeding the maximum value (PR #212743)

Shengxin Pei via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 20 11:21:53 PDT 2026


================
@@ -4091,7 +4091,7 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok, Scope *UDLScope) {
           !Context.getTargetInfo().hasInt128Type())
         PP.Diag(Tok.getLocation(), diag::err_integer_literal_too_large)
             << Literal.isUnsigned;
-      BitsNeeded = Literal.MicrosoftInteger;
+      BitsNeeded = std::max<unsigned>(BitsNeeded, Literal.MicrosoftInteger);
----------------
TPPPP72 wrote:

Yes, so I've already opened an issue to track. See #212731. But unrelated to this PR.

https://github.com/llvm/llvm-project/pull/212743


More information about the cfe-commits mailing list