pfultz2 added inline comments.

================
Comment at: lib/StaticAnalyzer/Checkers/ConversionChecker.cpp:77
     if (Opc == BO_Assign) {
-      LossOfSign = isLossOfSign(Cast, C);
-      LossOfPrecision = isLossOfPrecision(Cast, Cast->getType(), C);
+      if (!B->getRHS()->isIntegerConstantExpr(C.getASTContext())) {
+        LossOfSign = isLossOfSign(Cast, C);
----------------
george.karpenkov wrote:
> Sorry, I don't quite follow: why we don't want to warn when RHS is an integer 
> constant?
Because we want to treat `unsigned i = -1` as an explicit conversion. Ideally, 
I would like to just check that the RHS is a literal, but this seems like the 
closest way to do that.


Repository:
  rC Clang

https://reviews.llvm.org/D46081



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to