Improve the diagnostic for -Wcustom-atomic-properties. Suggestion by Fariborz!
[clang.git] / test / SemaObjC / id.m
blob27b84dedf8e664ec628995517b536e3571e7d482
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 @protocol Foo;
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; // expected-warning {{incompatible pointer types assigning to 'id<Foo>' from 'Class'}}
13   T = S; // expected-warning {{incompatible pointer types assigning to 'Class' from 'id<Foo>'}}
14   R = T; T = R;
15   R = S; S = R;
18 // Test attempt to redefine 'id' in an incompatible fashion.
19 typedef int id;  // FIXME: Decide how we want to deal with this (now that 'id' is more of a built-in type).
20 id b;