2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
2009-01-17 03:58:32 +08:00
|
|
|
|
2009-04-12 17:02:39 +08:00
|
|
|
@protocol Foo;
|
|
|
|
|
|
|
|
Class T;
|
|
|
|
id<Foo> S;
|
|
|
|
id R;
|
|
|
|
void foo() {
|
|
|
|
// Test assignment compatibility of Class and id. No warning should be
|
|
|
|
// produced.
|
|
|
|
// rdar://6770142 - Class and id<foo> are compatible.
|
2010-04-09 08:35:39 +08:00
|
|
|
S = T; // expected-warning {{incompatible pointer types assigning to 'id<Foo>' from 'Class'}}
|
|
|
|
T = S; // expected-warning {{incompatible pointer types assigning to 'Class' from 'id<Foo>'}}
|
2009-04-12 17:02:39 +08:00
|
|
|
R = T; T = R;
|
|
|
|
R = S; S = R;
|
|
|
|
}
|
2009-01-17 03:58:32 +08:00
|
|
|
|
2009-04-12 17:02:39 +08:00
|
|
|
// Test attempt to redefine 'id' in an incompatible fashion.
|
2009-07-11 07:34:53 +08:00
|
|
|
typedef int id; // FIXME: Decide how we want to deal with this (now that 'id' is more of a built-in type).
|
2009-01-17 03:58:32 +08:00
|
|
|
id b;
|
2009-04-12 17:02:39 +08:00
|
|
|
|