In incompatible pointer-typed ?: expressions, add implicit conversion
of RHSs to id type instead of void* if either has Objective-C object
type.
 - This ensures the result can still be used in normal places an
   object can be used, like a message send.

Add implicit conversions for ?: applied to qualified id types to
ensure that the RHSs are compatible. 
 - This prevents a codegen crash (creating invalid PHI nodes).
 - Again, this relates to the fact that qualified id types have no
   canonical types.
 - Note that the implicit type casted to is incorrect, however this
   doesn't currently cause problems because of the flexibility of the
   id type.

Test cases for above.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55346 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaObjC/conditional-expr2.m b/test/SemaObjC/conditional-expr2.m
new file mode 100644
index 0000000..440b72d
--- /dev/null
+++ b/test/SemaObjC/conditional-expr2.m
@@ -0,0 +1,12 @@
+// RUN: clang -fsyntax-only -verify %s
+
+@interface A
+@end
+@interface B
+@end
+
+void f0(int cond, A *a, B *b) {
+  // Ensure that we can still send a message to result of incompatible
+  // conditional expression.
+  [ (cond ? a : b) test ]; // expected-warning {{pointer type mismatch}}, expected-warning {{method '-test' not found}}
+}