diff options
Diffstat (limited to 'test/SemaObjC/ivar-lookup.m')
-rw-r--r-- | test/SemaObjC/ivar-lookup.m | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/SemaObjC/ivar-lookup.m b/test/SemaObjC/ivar-lookup.m index 06e47116f73ca..2b14bff85d841 100644 --- a/test/SemaObjC/ivar-lookup.m +++ b/test/SemaObjC/ivar-lookup.m @@ -35,3 +35,15 @@ extern struct foo x; } @end +@interface TwoIvars { + int a; + int b; +} +@end + +@implementation TwoIvars ++ (int)classMethod { + return a + b; // expected-error{{instance variable 'a' accessed in class method}} \ + // expected-error{{instance variable 'b' accessed in class method}} +} +@end |