// Explicit ivar refs need to have a cast inserted.
// FIXME: consider sharing some of this code with the code above.
- if (const PointerType *pType = IV->getBase()->getType()->getAs<PointerType>()) {
- ObjCInterfaceType *iFaceDecl = dyn_cast<ObjCInterfaceType>(pType->getPointeeType());
+ if (IV->isArrow()) {
+ ObjCInterfaceType *iFaceDecl =
+ dyn_cast<ObjCInterfaceType>(BaseExpr->getType()->getPointeeType());
// lookup which class implements the instance variable.
ObjCInterfaceDecl *clsDeclared = 0;
iFaceDecl->getDecl()->lookupInstanceVariable(D->getIdentifier(),
-// RUN: %clang_cc1 -rewrite-objc %s -o -
+// RUN: %clang_cc1 -rewrite-objc -fms-extensions %s -o -
// radar 7490331
@interface Foo {
@end
@implementation Foo
+// radar 7522803
+static void foo(id bar) {
+ int i = ((Foo *)bar)->a;
+}
+
- (void)bar {
a = 42;
[self baz:b];