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). --- clang/test/SemaObjC/class-method-self.m | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 clang/test/SemaObjC/class-method-self.m (limited to 'clang/test/SemaObjC/class-method-self.m') diff --git a/clang/test/SemaObjC/class-method-self.m b/clang/test/SemaObjC/class-method-self.m new file mode 100644 index 0000000..b1e37bf --- /dev/null +++ b/clang/test/SemaObjC/class-method-self.m @@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -verify -Wno-objc-root-class %s + +typedef struct objc_class *Class; +@interface XX + +- (void)addObserver:(XX*)o; // expected-note 2{{passing argument to parameter 'o' here}} + +@end + +@interface YY + ++ (void)classMethod; + +@end + +@implementation YY + +static XX *obj; + ++ (void)classMethod { + [obj addObserver:self]; // expected-warning {{incompatible pointer types sending 'Class' to parameter of type 'XX *'}} + Class whatever; + [obj addObserver:whatever]; // expected-warning {{incompatible pointer types sending 'Class' to parameter of type 'XX *'}} +} +@end + -- cgit v1.2.3