blob: 98904fe1ee9cc8a0da83cfc1f0a0977aec93109f [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -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