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

S. B. Tam via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 14 09:45:29 PST 2018


cpplearner marked 2 inline comments as done.
cpplearner added inline comments.


================
Comment at: clang/lib/AST/ExprConstant.cpp:3453
                                   Value) &&
            handleFloatFloatBinOp(Info, E, Value, Opcode, RHS.getFloat()) &&
            HandleFloatToFloatCast(Info, E, PromotedLHSType, SubobjType, Value);
----------------
rjmccall wrote:
> rsmith wrote:
> > Does this work for the float += int case?
> IIRC, the RHS gets promoted to the computation type in Sema.
Yes, in the float += int case, the RHS is the result of ImplicitCastExpr of kind IntegralToFloating. And `test_float()` contains test for that case.


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

https://reviews.llvm.org/D55413





More information about the cfe-commits mailing list