]> granicus.if.org Git - clang/commitdiff
Some minor aesthetic changes to the control flow.
authorSteve Naroff <snaroff@apple.com>
Mon, 27 Aug 2007 21:43:43 +0000 (21:43 +0000)
committerSteve Naroff <snaroff@apple.com>
Mon, 27 Aug 2007 21:43:43 +0000 (21:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41517 91177308-0d34-0410-b5e6-96231b3b80d8

Sema/SemaExpr.cpp

index 2e949ba22c0259d79cca352e53b0ab9f08fcacb3..b715556ce2ced1ad4aa9abc13a623b24663e3d26 100644 (file)
@@ -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()) {