blob: ecc6f99c7605848d9d3a6876784b1ad48011416e [file] [log] [blame]
/* Test instance variable visibility. */
/* Author: Dimitris Papavasiliou <dpapavas@gmail.com>. */
/* { dg-do compile } */
/* { dg-additional-options "-fivar-visibility=private" } */
#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 private" } */
}
@end