diff options
Diffstat (limited to 'test/SemaObjCXX/class-method-self.mm')
-rw-r--r-- | test/SemaObjCXX/class-method-self.mm | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/SemaObjCXX/class-method-self.mm b/test/SemaObjCXX/class-method-self.mm new file mode 100644 index 0000000000..560c1a14a5 --- /dev/null +++ b/test/SemaObjCXX/class-method-self.mm @@ -0,0 +1,25 @@ +// RUN: %clang_cc1 -verify -Wno-objc-root-class %s +// FIXME: expected-no-diagnostics +@interface XX + +- (void)addObserver:(XX*)o; // FIXME -- should note 2{{passing argument to parameter 'o' here}} + +@end + +@interface YY + ++ (void)classMethod; + +@end + +@implementation YY + +static XX *obj; + ++ (void)classMethod { + [obj addObserver:self]; // FIXME -- should error {{cannot initialize a parameter of type 'XX *' with an lvalue of type 'Class'}} + Class whatever; + [obj addObserver:whatever]; // FIXME -- should error {{cannot initialize a parameter of type 'XX *' with an lvalue of type 'Class'}} +} +@end + |