xref: /llvm-project/clang/test/SemaObjC/opaque-is-access.m (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
1// RUN: %clang -target x86_64-apple-darwin -arch arm64 -mios-version-min=7 -fsyntax-only %s -Xclang -verify
2// RUN: %clang -target x86_64-apple-darwin -arch x86_64 -mios-simulator-version-min=7 -fsyntax-only %s -Xclang -verify
3
4typedef struct objc_object {
5  struct objc_class *isa;
6} *id;
7
8@interface NSObject {
9  struct objc_class *isa;
10}
11@end
12@interface Whatever : NSObject
13+self;
14@end
15
16static void func(void) {
17
18  id x;
19
20  [(*x).isa self]; // expected-error {{direct access to Objective-C's isa is deprecated in favor of object_getClass()}}
21  [x->isa self];   // expected-error {{direct access to Objective-C's isa is deprecated in favor of object_getClass()}}
22}
23