================
@@ -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;
----------------
HerrCai0907 wrote:
thanks, it is better than current solution.
https://github.com/llvm/llvm-project/pull/116591
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits