[PATCH] D55413: [ExprConstant] Handle compound assignment when LHS has integral type and RHS has floating point type

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 11 21:39:01 PST 2018


rjmccall added inline comments.


================
Comment at: clang/lib/AST/ExprConstant.cpp:3441
+                                  Value);
+    }
     APSInt LHS = HandleIntToIntCast(Info, E, PromotedLHSType,
----------------
Can we more fundamentally restructure this entire handler so that, if the compound assignment's computation result type is an arithmetic type, we just promote both operands to that type, do the arithmetic there, and then coerce back down?  This is C++, so the LHS type imposes almost no restrictions on the RHS type; also, this is Clang, where we support way too many arithmetic types for our own good.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55413/new/

https://reviews.llvm.org/D55413





More information about the cfe-commits mailing list