comparison clang/test/SemaObjC/id.m @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900
parents 1d019706d866
children
comparison
equal deleted inserted replaced
232:70dce7da266c 236:c4bab56944e8
3 @protocol Foo; 3 @protocol Foo;
4 4
5 Class T; 5 Class T;
6 id<Foo> S; 6 id<Foo> S;
7 id R; 7 id R;
8 void foo() { 8 void foo(void) {
9 // Test assignment compatibility of Class and id. No warning should be 9 // Test assignment compatibility of Class and id. No warning should be
10 // produced. 10 // produced.
11 // rdar://6770142 - Class and id<foo> are compatible. 11 // rdar://6770142 - Class and id<foo> are compatible.
12 S = T; // expected-warning {{incompatible pointer types assigning to 'id<Foo>' from 'Class'}} 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>'}} 13 T = S; // expected-warning {{incompatible pointer types assigning to 'Class' from 'id<Foo>'}}