================ @@ -393,8 +393,14 @@ void NarrowingConversionsCheck::handleIntegralCast(const ASTContext &Context, const Expr &Lhs, const Expr &Rhs) { if (WarnOnIntegerNarrowingConversion) { + // From [conv.integral] since C++20 + // The result is the unique value of the destination type that is congruent + // to the source integer modulo 2^N, where N is the width of the destination + // type. + if (getLangOpts().CPlusPlus20) + return; ---------------- PiotrZSL wrote:
Better would-be to change default value for WarnOnIntegerNarrowingConversion on C++20. We could use `optional<bool>` for that option, and if not set then it could assing value based on C++20 being used or not. https://github.com/llvm/llvm-project/pull/116591 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits