Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Fariborz Jahanian | c55a240 | 2009-01-16 19:58:32 +0000 | [diff] [blame] | 2 | |
Chris Lattner | 2c4463f | 2009-04-12 09:02:39 +0000 | [diff] [blame] | 3 | @protocol Foo; |
| 4 | |
| 5 | Class T; |
| 6 | id<Foo> S; |
| 7 | id R; |
| 8 | void 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 Naroff | 14108da | 2009-07-10 23:34:53 +0000 | [diff] [blame] | 18 | typedef int id; // FIXME: Decide how we want to deal with this (now that 'id' is more of a built-in type). |
Fariborz Jahanian | c55a240 | 2009-01-16 19:58:32 +0000 | [diff] [blame] | 19 | id b; |
Chris Lattner | 2c4463f | 2009-04-12 09:02:39 +0000 | [diff] [blame] | 20 | |