[clang] [Clang] [Sema] Fix bug in `_Complex float`+`int` arithmetic (PR #83063)

via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 5 07:19:21 PST 2024


================
@@ -1114,8 +1114,6 @@ static bool handleIntegerToComplexFloatConversion(Sema &S, ExprResult &IntExpr,
   if (IntTy->isIntegerType()) {
     QualType fpTy = ComplexTy->castAs<ComplexType>()->getElementType();
     IntExpr = S.ImpCastExprToType(IntExpr.get(), fpTy, CK_IntegralToFloating);
-    IntExpr = S.ImpCastExprToType(IntExpr.get(), ComplexTy,
-                                  CK_FloatingRealToComplex);
----------------
Sirraide wrote:

I’ve updated the comments and also renamed `handleIntegerToComplexFloatConversion()` to `handleComplexIntegerToFloatConversion()` since the result is no longer always a complex float.

https://github.com/llvm/llvm-project/pull/83063


More information about the cfe-commits mailing list