diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2014-11-14 21:54:46 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2014-11-14 21:54:46 +0000 |
commit | d0babbfe56b84df88b8e0a29c04b05d565c2dce2 (patch) | |
tree | d260b1e6a96f4ad103e4781c0edbd5d1a223a2af /lib/Sema/SemaExpr.cpp | |
parent | 1651a71ff2b564407bf2a02819b5efcdf87382a3 (diff) |
Again revert r222044 to resolve darwin objc test fails.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222047 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 1429df778b..dde3f3764f 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -5711,7 +5711,7 @@ QualType Sema::CheckConditionalOperands(ExprResult &Cond, ExprResult &LHS, RHS.get()->getType()->isVectorType()) return CheckVectorOperands(LHS, RHS, QuestionLoc, /*isCompAssign*/false); - QualType ResTy = UsualArithmeticConversions(LHS, RHS); + UsualArithmeticConversions(LHS, RHS); if (LHS.isInvalid() || RHS.isInvalid()) return QualType(); @@ -5728,12 +5728,8 @@ QualType Sema::CheckConditionalOperands(ExprResult &Cond, ExprResult &LHS, // If both operands have arithmetic type, do the usual arithmetic conversions // to find a common type: C99 6.5.15p3,5. - if (LHSTy->isArithmeticType() && RHSTy->isArithmeticType()) { - LHS = ImpCastExprToType(LHS.get(), ResTy, PrepareScalarCast(LHS, ResTy)); - RHS = ImpCastExprToType(RHS.get(), ResTy, PrepareScalarCast(RHS, ResTy)); - - return ResTy; - } + if (LHSTy->isArithmeticType() && RHSTy->isArithmeticType()) + return LHS.get()->getType(); // If both operands are the same structure or union type, the result is that // type. |