[PATCH] D50467: [SEMA] add more -Wfloat-conversion to compound assigment analysis

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 8 11:32:56 PDT 2018


nickdesaulniers added inline comments.


================
Comment at: lib/Sema/SemaChecking.cpp:10413-10416
+  // If source is floating point but target is not.
+  if (!ResultBT->isFloatingPoint())
+    return DiagnoseFloatingImpCast(S, E, E->getRHS()->getType(),
+                                   E->getExprLoc());
----------------
This is essentially the only new code.  AnalyzeCompoundAssignment was moved in order to be able to call DiagnoseFloatingImpCast (it's defined above). The rest is a small refactoring of the conditionals.


Repository:
  rC Clang

https://reviews.llvm.org/D50467





More information about the cfe-commits mailing list