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

Joshua Cranmer via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 4 10:44:55 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);
----------------
jcranmer-intel wrote:

This change makes the comment on this method and the comment in `handleComplexConversion` inaccurate; it would be a good idea to update those comments to indicate what is actually happening here.

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


More information about the cfe-commits mailing list