diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-07-16 23:34:22 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-16 23:34:22 +0000 |
commit | a3f41f4bbaf080a3b693c8d4a0cfa3f40e8ed42e (patch) | |
tree | 04db4742fcfb426960fcd0fbc9b317c541e9ab60 | |
parent | c5df7e2dc12113ea77f8b3fe4ed15ae6ef4eb16e (diff) | |
download | bcm5719-llvm-a3f41f4bbaf080a3b693c8d4a0cfa3f40e8ed42e.tar.gz bcm5719-llvm-a3f41f4bbaf080a3b693c8d4a0cfa3f40e8ed42e.zip |
Some more ?: for Obj-C tests.
llvm-svn: 76125
-rw-r--r-- | clang/test/SemaObjC/conditional-expr.m | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/conditional-expr.m b/clang/test/SemaObjC/conditional-expr.m index e7855163f18..8ae13382772 100644 --- a/clang/test/SemaObjC/conditional-expr.m +++ b/clang/test/SemaObjC/conditional-expr.m @@ -92,3 +92,30 @@ void f5(int cond, id<P0> x, C *y) { void f6(int cond, C *x, D *y) { (cond ? x : y).intProp = 1; // expected-warning {{incompatible operand types}}, expected-error {{property 'intProp' not found on object of type 'id'}} } + +id f7(int a, id<P0> x, A* p) { + return a ? x : p; +} + +void f8(int a, A<P0> *x, A *y) { + [ (a ? x : y ) intProp ]; +} + +void f9(int a, A<P0> *x, A<P1> *y) { + id l0 = (a ? x : y ); // expected-warning {{incompatible operand types ('A<P0> *' and 'A<P1> *')'}} + A<P0> *l1 = (a ? x : y ); // expected-warning {{incompatible operand types ('A<P0> *' and 'A<P1> *')}} + A<P1> *l2 = (a ? x : y ); // expected-warning {{incompatible operand types ('A<P0> *' and 'A<P1> *')}} + [ (a ? x : y ) intProp ]; // expected-warning {{incompatible operand types ('A<P0> *' and 'A<P1> *')}} +} + +void f10(int a, id<P0> x, id y) { + [ (a ? x : y ) intProp ]; +} + +void f11(int a, id<P0> x, id<P1> y) { + [ (a ? x : y ) intProp ]; // expected-warning {{incompatible operand types ('id<P0>' and 'id<P1>')}} +} + +void f12(int a, A<P0> *x, A<P1> *y) { + A<P1>* l0 = (a ? x : y ); // expected-warning {{incompatible operand types ('A<P0> *' and 'A<P1> *')}} +} |