================ @@ -12091,6 +12091,11 @@ void Sema::CheckImplicitConversion(Expr *E, QualType T, SourceLocation CC, if (SourceMgr.isInSystemMacro(CC)) return; + if (const auto *UO = dyn_cast<UnaryOperator>(E)) { + return DiagnoseImpCast(*this, E, T, CC, + diag::warn_impcast_integer_precision_on_negation); + } + ---------------- cor3ntin wrote:
We should check which operator it is. Did you try to add tests with ``` unsigned char test_diag(unsigned char x) { return +x; }``` https://github.com/llvm/llvm-project/pull/139429 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits