Slight refactoring; catch yet another case where we were missing an lvalue-to-rvalue conversion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149003 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index 0eb8d28..fdcad08 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -495,12 +495,8 @@
if (!Cond)
return StmtError();
- CondResult = DefaultFunctionArrayLvalueConversion(Cond);
- if (CondResult.isInvalid())
- return StmtError();
-
CondResult
- = ConvertToIntegralOrEnumerationType(SwitchLoc, CondResult.take(),
+ = ConvertToIntegralOrEnumerationType(SwitchLoc, Cond,
PDiag(diag::err_typecheck_statement_requires_integer),
PDiag(diag::err_switch_incomplete_class_type)
<< Cond->getSourceRange(),