xref: /minix3/external/bsd/llvm/dist/clang/test/SemaObjC/property-expression-error.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1  -fsyntax-only -verify -Wno-objc-root-class %s
2*f4a2713aSLionel Sambuc
3*f4a2713aSLionel Sambuc@interface AddressMyProperties
4*f4a2713aSLionel Sambuc{
5*f4a2713aSLionel Sambuc  unsigned index;
6*f4a2713aSLionel Sambuc}
7*f4a2713aSLionel Sambuc@property unsigned index;
8*f4a2713aSLionel Sambuc@end
9*f4a2713aSLionel Sambuc
10*f4a2713aSLionel Sambuc@implementation AddressMyProperties
11*f4a2713aSLionel Sambuc@synthesize index;
12*f4a2713aSLionel Sambuc@end
13*f4a2713aSLionel Sambuc
14*f4a2713aSLionel Sambucint main() {
15*f4a2713aSLionel Sambuc	AddressMyProperties *object;
16*f4a2713aSLionel Sambuc	&object.index; // expected-error {{address of property expression requested}}
17*f4a2713aSLionel Sambuc	return 0;
18*f4a2713aSLionel Sambuc}
19*f4a2713aSLionel Sambuc
20*f4a2713aSLionel Sambuctypedef int Foo;
21*f4a2713aSLionel Sambucvoid test() {
22*f4a2713aSLionel Sambuc  Foo.x;	// expected-error {{expected identifier or '('}}
23*f4a2713aSLionel Sambuc}
24