blob: eb41c8f4db025e917bbb28de16aa32d7608a6cd9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
/* Test instance variable visibility. */
/* Author: Dimitris Papavasiliou <dpapavas@gmail.com>. */
/* { dg-do compile } */
/* { dg-additional-options "-fivar-visibility=protected" } */
#include <objc/objc.h>
@interface MySuperClass
{
int someivar;
}
@end
@implementation MySuperClass
@end
@interface MyClass : MySuperClass
@end
@implementation MyClass
@end
@interface MyOtherClass
- (void) test: (MyClass *) object;
@end
@implementation MyOtherClass
- (void) test: (MyClass *) object
{
int a;
a = object->someivar; /* { dg-error "instance variable .someivar. is declared protected" } */
}
@end
|