Do implicit conversion to bool for the condition in a do-while statement.

llvm-svn: 56096
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index 706bcdd..d7a812c 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/lib/Sema/SemaStmt.cpp
@@ -530,7 +530,10 @@
   DefaultFunctionArrayConversion(condExpr);
   QualType condType = condExpr->getType();
   
-  if (!condType->isScalarType()) // C99 6.8.5p2
+  if (getLangOptions().CPlusPlus) {
+    if (CheckCXXBooleanCondition(condExpr)) // C++ 6.4p4
+      return true;
+  } else if (!condType->isScalarType()) // C99 6.8.5p2
     return Diag(DoLoc, diag::err_typecheck_statement_requires_scalar,
              condType.getAsString(), condExpr->getSourceRange());