aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-06-04 00:29:51 +0000
committerJohn McCall <rjmccall@apple.com>2010-06-04 00:29:51 +0000
commit75f7c0f5a82689c5abe1f4c5b93bfe1fbe5feaa8 (patch)
tree2c7f328d4804220b791ca76169b8d22323ac4787
parent5f83c60d5d5e3a87f5281db8125755c65a72b070 (diff)
Remove a couple of unnecessary uses of IsStandardConversion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105445 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaExpr.cpp23
1 files changed, 6 insertions, 17 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index d4d4d1ea39..906fd08828 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -5663,25 +5663,14 @@ inline QualType Sema::CheckLogicalOperands( // C99 6.5.[13,14]
return Context.IntTy;
}
+ // The following is safe because we only use this method for
+ // non-overloadable operands.
+
// C++ [expr.log.and]p1
// C++ [expr.log.or]p1
- // The operands are both implicitly converted to type bool (clause 4).
- StandardConversionSequence LHS;
- if (!IsStandardConversion(lex, Context.BoolTy,
- /*InOverloadResolution=*/false, LHS))
- return InvalidOperands(Loc, lex, rex);
-
- if (PerformImplicitConversion(lex, Context.BoolTy, LHS,
- AA_Passing, /*IgnoreBaseAccess=*/false))
- return InvalidOperands(Loc, lex, rex);
-
- StandardConversionSequence RHS;
- if (!IsStandardConversion(rex, Context.BoolTy,
- /*InOverloadResolution=*/false, RHS))
- return InvalidOperands(Loc, lex, rex);
-
- if (PerformImplicitConversion(rex, Context.BoolTy, RHS,
- AA_Passing, /*IgnoreBaseAccess=*/false))
+ // The operands are both contextually converted to type bool.
+ if (PerformContextuallyConvertToBool(lex) ||
+ PerformContextuallyConvertToBool(rex))
return InvalidOperands(Loc, lex, rex);
// C++ [expr.log.and]p2