1*67e74705SXin Li// RUN: %clang_cc1 -fsyntax-only -verify %s 2*67e74705SXin Li 3*67e74705SXin Li@interface A 4*67e74705SXin Li@end 5*67e74705SXin Li@interface B 6*67e74705SXin Li@end 7*67e74705SXin Li 8*67e74705SXin Livoid f0(int cond, A *a, B *b) { 9*67e74705SXin Li // Ensure that we can still send a message to result of incompatible 10*67e74705SXin Li // conditional expression. 11*67e74705SXin Li [ (cond ? a : b) test ]; // expected-warning{{incompatible operand types ('A *' and 'B *')}} expected-warning {{method '-test' not found}} 12*67e74705SXin Li} 13*67e74705SXin Li 14*67e74705SXin Li@interface NSKey @end 15*67e74705SXin Li@interface KeySub : NSKey @end 16*67e74705SXin Li 17*67e74705SXin Li@interface UpdatesList @end 18*67e74705SXin Li 19*67e74705SXin Livoid foo (int i, NSKey *NSKeyValueCoding_NullValue, UpdatesList *nukedUpdatesList) 20*67e74705SXin Li{ 21*67e74705SXin Li id obj; 22*67e74705SXin Li NSKey *key; 23*67e74705SXin Li KeySub *keysub; 24*67e74705SXin Li 25*67e74705SXin Li obj = i ? NSKeyValueCoding_NullValue : nukedUpdatesList; // expected-warning{{incompatible operand types ('NSKey *' and 'UpdatesList *')}} 26*67e74705SXin Li key = i ? NSKeyValueCoding_NullValue : nukedUpdatesList; // expected-warning{{incompatible operand types ('NSKey *' and 'UpdatesList *')}} 27*67e74705SXin Li key = i ? NSKeyValueCoding_NullValue : keysub; 28*67e74705SXin Li keysub = i ? NSKeyValueCoding_NullValue : keysub; // expected-warning{{incompatible pointer types assigning to 'KeySub *' from 'NSKey *'}} 29*67e74705SXin Li} 30