1 // RUN: %clang_cc1 -fsyntax-only -verify %s
30 id<P0> l = x; // expected-warning {{initializing 'id<P0>' with an expression of incompatible type 'id<P1>'}}
34 id<P1> l = a; // expected-warning {{initializing 'id<P1>' with an expression of incompatible type 'A *'}}
37 void f4(int cond, id x, A *a) {
41 void f5(int cond, A *a, B *b) {
45 void f6(int cond, id x, A *a) {
46 bar(cond ? (id<P0, P1>) x : a);
49 void f7(int cond, id x, A *a) {
50 bar(cond ? a : (id<P0, P1>) x);
53 void f8(int cond, id<P0,P1> x0, id<P0,P2> x1) {
54 barP0(cond ? x0 : x1); // expected-warning {{incompatible operand types ('id<P0,P1>' and 'id<P0,P2>')}}
57 void f9(int cond, id<P0,P1> x0, id<P0,P2> x1) {
58 barP1(cond ? x0 : x1); // expected-warning {{incompatible operand types ('id<P0,P1>' and 'id<P0,P2>')}}
61 void f10(int cond, id<P0,P1> x0, id<P0,P2> x1) {
62 barP2(cond ? x0 : x1); // expected-warning {{incompatible operand types ('id<P0,P1>' and 'id<P0,P2>')}}
65 int f11(int cond, A* a, B* b) {
66 return (cond? b : a)->x; // expected-error{{'A' does not have a member named 'x'}}