================ @@ -3924,10 +3924,18 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok, Scope *UDLScope) { // to get the integer value from an overly-wide APInt is *extremely* // expensive, so the naive approach of assuming // llvm::IntegerType::MAX_INT_BITS is a big performance hit. - unsigned BitsNeeded = - Literal.isBitInt ? llvm::APInt::getSufficientBitsNeeded( - Literal.getLiteralDigits(), Literal.getRadix()) - : Context.getTargetInfo().getIntMaxTWidth(); + unsigned BitsNeeded = Context.getTargetInfo().getIntMaxTWidth(); + if (Literal.isBitInt) + BitsNeeded = llvm::APInt::getSufficientBitsNeeded( + Literal.getLiteralDigits(), Literal.getRadix()); + if (Literal.MicrosoftInteger) { + if (Literal.MicrosoftInteger == 128 && ---------------- compnerd wrote:
Yes, it needs a double check. The first check is to check if we have a Microsoft extended numeric literal. The second check is a bitwidth check to ensure that we have a type capable of representing it. It is specifically to emit the diagnostic. Either way, we set the number of required bits to properly process the numeric literal. https://github.com/llvm/llvm-project/pull/130993 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits