From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- .../test/SemaObjC/ivar-lookup-resolution-builtin.m | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 clang/test/SemaObjC/ivar-lookup-resolution-builtin.m (limited to 'clang/test/SemaObjC/ivar-lookup-resolution-builtin.m') diff --git a/clang/test/SemaObjC/ivar-lookup-resolution-builtin.m b/clang/test/SemaObjC/ivar-lookup-resolution-builtin.m new file mode 100644 index 0000000..dd11b51 --- /dev/null +++ b/clang/test/SemaObjC/ivar-lookup-resolution-builtin.m @@ -0,0 +1,40 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s +// pr5986 + +@interface Test { + int index; +} +- (int) index; ++ (int) ClassMethod; +@end + +@implementation Test +- (int) index +{ + return index; +} ++ (int) ClassMethod +{ + return index; // expected-error {{instance variable 'index' accessed in class method}} +} +@end + +@interface Test1 { +} +- (int) InstMethod; ++ (int) ClassMethod; +@end + +@implementation Test1 +- (int) InstMethod +{ + return index; // expected-warning {{implicitly declaring library function 'index'}} \ + // expected-note {{please include the header or explicitly provide a declaration for 'index'}} \ + // expected-warning {{incompatible pointer to integer conversion returning}} +} ++ (int) ClassMethod +{ + return index; // expected-warning {{incompatible pointer to integer conversion returning}} +} +@end + -- cgit v1.2.3