(aka, Fariborz was right ;-)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101046
91177308-0d34-0410-b5e6-
96231b3b80d8
// If this scope is an objc method scope, then we succeed.
if (S->getFlags() & ObjCMethodScope)
return true;
-
- // If we've scanned up the scope chain and find out that we're in some
- // other body scope (e.g. a block), we fail even if it is ultimately
- // contained in an ObjC method body.
- if (S->getFlags() & FnScope)
- return false;
}
return false;
}
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -fblocks %s
+
+void takevoidptr(void*);
+
@interface Foo
- iMethod;
@interface A
+ superClassMethod;
+- (void)instanceMethod;
@end
@interface B : A
- (void)instanceMethod {
[super iMethod]; // expected-warning{{'A' may not respond to 'iMethod')}}
+
+ // Use of super in a block is ok and does codegen to the right thing.
+ // rdar://7852959
+ takevoidptr(^{
+ [super instanceMethod];
+ });
}
+ classMethod {
id X[] = { [ super superClassMethod] };
return 0;
}
+
+