From: Steve Naroff Date: Mon, 27 Aug 2007 21:43:43 +0000 (+0000) Subject: Some minor aesthetic changes to the control flow. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2996036d53beafed6e18324290e2ea5c0354c1be;p=clang Some minor aesthetic changes to the control flow. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41517 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Sema/SemaExpr.cpp b/Sema/SemaExpr.cpp index 2e949ba22c..b715556ce2 100644 --- a/Sema/SemaExpr.cpp +++ b/Sema/SemaExpr.cpp @@ -837,19 +837,16 @@ QualType Sema::UsualArithmeticConversions(Expr *&lhsExpr, Expr *&rhsExpr, // does not require this promotion. if (lhs != rhs) { // Domains don't match, we have complex/float mix. if (lhs->isRealFloatingType()) { // handle "double, _Complex double". - if (isCompAssign) - return rhs; - promoteExprToType(lhsExpr, rhs); + if (!isCompAssign) + promoteExprToType(lhsExpr, rhs); + return rhs; } else { // handle "_Complex double, double". - if (isCompAssign) - return lhs; - promoteExprToType(rhsExpr, lhs); + if (!isCompAssign) + promoteExprToType(rhsExpr, lhs); + return lhs; } - // Both expressions now have the same rank/domain. - return lhsExpr->getType(); } - // The domain/size match, simply return lhs (which may have been converted). - return lhs; + return lhs; // The domain/size match exactly. } // Now handle "real" floating types (i.e. float, double, long double). if (lhs->isRealFloatingType() || rhs->isRealFloatingType()) {