Expr *Ex = E.takeAs<Expr>();
if (Ex) return Owned(Ex);
// Synthesize ivars lazily
- if (getLangOptions().ObjCNonFragileABI2) {
+ if (getLangOptions().ObjCDefaultSynthProperties &&
+ getLangOptions().ObjCNonFragileABI2) {
if (SynthesizeProvisionalIvar(*this, R, II, NameLoc)) {
if (const ObjCPropertyDecl *Property =
canSynthesizeProvisionalIvar(II)) {
if (VarDecl *Var = R.getAsSingle<VarDecl>()) {
if (getLangOptions().ObjCNonFragileABI && IvarLookupFollowUp &&
- !getLangOptions().ObjCNonFragileABI2 &&
+ !(getLangOptions().ObjCDefaultSynthProperties &&
+ getLangOptions().ObjCNonFragileABI2) &&
Var->isFileVarDecl()) {
ObjCPropertyDecl *Property = canSynthesizeProvisionalIvar(II);
if (Property) {
return 0;
}
IC->addPropertyImplementation(PIDecl);
- if (getLangOptions().ObjCNonFragileABI2) {
+ if (getLangOptions().ObjCDefaultSynthProperties &&
+ getLangOptions().ObjCNonFragileABI2) {
// Diagnose if an ivar was lazily synthesdized due to a previous
// use and if 1) property is @dynamic or 2) property is synthesized
// but it requires an ivar of different name.