This change is incorrect. The usual arithmetic conversions do *not* take 
`(_Complex double, double)` to `(_Complex double, _Complex double)`; note C11 
6.13.1.8/1 ("... without change of type domain").

The bug lies in the conditional operator; per 6.5.15/5, "If both the second and 
third operands have arithmetic type, the result type that would be determined 
by the usual arithmetic conversions, were they applied to those two operands, 
is the type of the result." The problem is that `CheckConditionalOperands` 
discards the result of `UsualArithmeticConversions` (that is, the result type), 
and instead blindly uses the LHS type. The right place for this fix is there 
`CheckConditionalOperands` (and in `CXXCheckConditionalOperands`).

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D6217



_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to