blob: 1781ce71d9c3385115d00e1646804e8879529f10 [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -fsyntax-only -verify %s
Fariborz Jahanianc55a2402009-01-16 19:58:32 +00002
Chris Lattner2c4463f2009-04-12 09:02:39 +00003@protocol Foo;
4
5Class T;
6id<Foo> S;
7id R;
8void foo() {
9 // Test assignment compatibility of Class and id. No warning should be
10 // produced.
11 // rdar://6770142 - Class and id<foo> are compatible.
12 S = T; T = S;
13 R = T; T = R;
14 R = S; S = R;
15}
16
17// Test attempt to redefine 'id' in an incompatible fashion.
Fariborz Jahanianc55a2402009-01-16 19:58:32 +000018typedef int id; // expected-error {{typedef redefinition with different types}}
Fariborz Jahanianc55a2402009-01-16 19:58:32 +000019id b;
Chris Lattner2c4463f2009-04-12 09:02:39 +000020