================
@@ -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);
----------------
Sirraide wrote:

I think this deserves a comment because the fact that MSVC just... truncates 
the literal value rather than diagnosing that it doesn't fit in the requested 
bit width is very unintuitive.

https://github.com/llvm/llvm-project/pull/212743
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to