blob: 70d981c42b1711efe50b9e0882c092bc9fb540ca [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.
Steve Naroff14108da2009-07-10 23:34:53 +000018typedef int id; // FIXME: Decide how we want to deal with this (now that 'id' is more of a built-in type).
Fariborz Jahanianc55a2402009-01-16 19:58:32 +000019id b;
Chris Lattner2c4463f2009-04-12 09:02:39 +000020