blob: fdf3d1381a87f9588949d1736cc66e5218b15383 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Daniel Dunbara56f7462008-08-26 00:41:39 +00002
3@interface A
4@end
5@interface B
6@end
7
8void f0(int cond, A *a, B *b) {
9 // Ensure that we can still send a message to result of incompatible
10 // conditional expression.
Mike Stumpdd3e1662009-05-07 03:14:14 +000011 [ (cond ? a : b) test ]; // expected-warning{{incompatible operand types ('A *' and 'B *')}} expected-warning {{method '-test' not found}}
Steve Naroff1fd03612009-02-12 19:05:07 +000012}
13
14@interface NSKey @end
15@interface KeySub : NSKey @end
16
17@interface UpdatesList @end
18
19void foo (int i, NSKey *NSKeyValueCoding_NullValue, UpdatesList *nukedUpdatesList)
20{
21 id obj;
22 NSKey *key;
23 KeySub *keysub;
24
Mike Stumpdd3e1662009-05-07 03:14:14 +000025 obj = i ? NSKeyValueCoding_NullValue : nukedUpdatesList; // expected-warning{{incompatible operand types ('NSKey *' and 'UpdatesList *')}}
26 key = i ? NSKeyValueCoding_NullValue : nukedUpdatesList; // expected-warning{{incompatible operand types ('NSKey *' and 'UpdatesList *')}}
Steve Naroff1fd03612009-02-12 19:05:07 +000027 key = i ? NSKeyValueCoding_NullValue : keysub;
Douglas Gregord4eea832010-04-09 00:35:39 +000028 keysub = i ? NSKeyValueCoding_NullValue : keysub; // expected-warning{{incompatible pointer types assigning to 'KeySub *' from 'NSKey *'}}
Daniel Dunbara56f7462008-08-26 00:41:39 +000029}