brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 23371aa Raw
30 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3@interface A4@end5@interface B6@end7 8void f0(int cond, A *a, B *b) {9  // Ensure that we can still send a message to result of incompatible10  // conditional expression.11  [ (cond ? a : b) test ]; // expected-warning{{incompatible operand types ('A *' and 'B *')}} expected-warning {{method '-test' not found}}12}13 14@interface NSKey @end15@interface KeySub : NSKey @end16 17@interface UpdatesList @end18 19void foo (int i, NSKey *NSKeyValueCoding_NullValue, UpdatesList *nukedUpdatesList)20{21  id obj;22  NSKey *key;23  KeySub *keysub;24 25  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 *')}}27  key = i ? NSKeyValueCoding_NullValue : keysub;28  keysub = i ? NSKeyValueCoding_NullValue : keysub; // expected-error{{incompatible pointer types assigning to 'KeySub *' from 'NSKey *'}}29}30