diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-01-18 18:49:33 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-01-18 18:49:33 +0000 |
commit | e188933adf2cfe2821b8acba2de6d5d152bc246b (patch) | |
tree | 13cf107121e12a91f893f300af0d958542cff959 /lib/Sema/SemaExpr.cpp | |
parent | 6eb5be81ca17bc64de0b856fde8f5a9a90757489 (diff) |
Properly do a float -> _Complex double conversion, fixes rdar://8875946.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123759 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 45e0c3377b..e2e802c790 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -528,7 +528,8 @@ QualType Sema::UsualArithmeticConversions(Expr *&lhsExpr, Expr *&rhsExpr, if (order < 0) { // RHS is wider // float -> _Complex double if (!isCompAssign) { - ImpCastExprToType(lhsExpr, rhs, CK_FloatingCast); + QualType fp = cast<ComplexType>(rhs)->getElementType(); + ImpCastExprToType(lhsExpr, fp, CK_FloatingCast); ImpCastExprToType(lhsExpr, rhs, CK_FloatingRealToComplex); } return rhs; |