2012-04-07 02:12:22 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -Wno-objc-root-class %s
|
|
|
|
// RUN: %clang_cc1 -x objective-c++ -triple x86_64-apple-darwin10 -fsyntax-only -verify -Wno-objc-root-class %s
|
2011-03-27 03:48:30 +08:00
|
|
|
// rdar://9005189
|
|
|
|
|
|
|
|
@interface Foo
|
|
|
|
@end
|
|
|
|
|
|
|
|
struct Bar {
|
|
|
|
int x;
|
|
|
|
};
|
|
|
|
|
|
|
|
@implementation Foo {
|
|
|
|
struct Bar bar;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (const struct Bar)bar {
|
|
|
|
return bar;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)baz {
|
|
|
|
bar.x = 0;
|
2012-07-20 02:10:18 +08:00
|
|
|
[self bar].x = 10; // expected-error {{assigning to 'readonly' return result of an Objective-C message not allowed}}
|
2011-03-27 03:48:30 +08:00
|
|
|
}
|
|
|
|
@end
|