Make sure the types are consistent for a void conditional.  No visible 
difference, but it's better to be consistent.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51961 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 4673ae4..8d38248 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -917,15 +917,15 @@
   // C99 6.5.15p5: "If both operands have void type, the result has void type."
   // The following || allows only one side to be void (a GCC-ism).
   if (lexT->isVoidType() || rexT->isVoidType()) {
-    if (!lexT->isVoidType()) {
+    if (!lexT->isVoidType())
       Diag(rex->getLocStart(), diag::ext_typecheck_cond_one_void, 
            rex->getSourceRange());
-      return rexT.getUnqualifiedType();
-    }
     if (!rexT->isVoidType())
       Diag(lex->getLocStart(), diag::ext_typecheck_cond_one_void,
            lex->getSourceRange());
-    return lexT.getUnqualifiedType();
+    ImpCastExprToType(lex, Context.VoidTy);
+    ImpCastExprToType(rex, Context.VoidTy);
+    return Context.VoidTy;
   }
   // C99 6.5.15p6 - "if one operand is a null pointer constant, the result has
   // the type of the other operand."