class InitSelfBug : public BugType {
const std::string desc;
public:
- InitSelfBug() : BugType("missing \"self = [{initializer}]\"",
- "missing \"self = [{initializer}]\"") {}
+ InitSelfBug() : BugType("missing \"self = [(super or self) init...]\"",
+ "missing \"self = [(super or self) init...]\"") {}
};
} // end anonymous namespace
return;
checkForInvalidSelf(E->getBase(), C,
- "Using an ivar before setting 'self' to the result of an initializer");
+ "Instance variable used before setting 'self' to the result of "
+ "'[(super or self) init...]'");
}
void ObjCSelfInitChecker::PreVisitReturnStmt(CheckerContext &C,
return;
checkForInvalidSelf(S->getRetValue(), C,
- "Returning 'self' before setting it to the result of an initializer");
+ "Returning 'self' before setting it to the result of "
+ "'[(super or self) init...]'");
}
// When a call receives a reference to 'self', [Pre/Post]VisitGenericCall pass
}
-(id)init6 {
- [NSBundle loadNibNamed:@"Window" owner:myivar]; // expected-warning {{Using an ivar}}
+ [NSBundle loadNibNamed:@"Window" owner:myivar]; // expected-warning {{Instance variable used}}
return [self initWithSomething:0];
}
}
-(id)init10 {
- myivar = 0; // expected-warning {{Using an ivar}}
+ myivar = 0; // expected-warning {{Instance variable used}}
return self;
}
-(id)init13 {
if ((self == [super init])) {
- myivar = 0; // expected-warning {{Using an ivar}}
+ myivar = 0; // expected-warning {{Instance variable used}}
}
return self; // expected-warning {{Returning 'self'}}
}