} // anonymous namespace
-static void clearRedundantStrongs(MigrationContext &MigrateCtx) {
- TransformActions &TA = MigrateCtx.Pass.TA;
-
- for (unsigned i = 0, e = MigrateCtx.GCAttrs.size(); i != e; ++i) {
- MigrationContext::GCAttrOccurrence &Attr = MigrateCtx.GCAttrs[i];
- if (Attr.Kind == MigrationContext::GCAttrOccurrence::Strong &&
- Attr.FullyMigratable && Attr.Dcl) {
- TypeSourceInfo *TInfo = 0;
- if (DeclaratorDecl *DD = dyn_cast<DeclaratorDecl>(Attr.Dcl))
- TInfo = DD->getTypeSourceInfo();
- else if (ObjCPropertyDecl *PD = dyn_cast<ObjCPropertyDecl>(Attr.Dcl))
- TInfo = PD->getTypeSourceInfo();
- if (!TInfo)
- continue;
-
- if (TInfo->getType().getObjCLifetime() == Qualifiers::OCL_Strong) {
- Transaction Trans(TA);
- TA.remove(Attr.Loc);
- MigrateCtx.RemovedAttrSet.insert(Attr.Loc.getRawEncoding());
- }
- }
- }
-}
-
static void errorForGCAttrsOnNonObjC(MigrationContext &MigrateCtx) {
TransformActions &TA = MigrateCtx.Pass.TA;
GCAttrsCollector(MigrateCtx, AllProps).TraverseDecl(
MigrateCtx.Pass.Ctx.getTranslationUnitDecl());
- clearRedundantStrongs(MigrateCtx);
errorForGCAttrsOnNonObjC(MigrateCtx);
checkAllProps(MigrateCtx, AllProps);
checkWeakGCAttrs(MigrateCtx);
id x = NSMakeCollectable(cft);
}
-@interface I1 {
- __strong I1 *myivar;
-}
+@interface I1
@end
@implementation I1
@implementation rdar10532449
@synthesize assign_prop, strong_readonly_prop, weak_prop;
@end
+
+void test2(id p, __strong I1 *ap[]) {
+ for (__strong I1 *specRule in p) {
+ }
+}
id x = CFBridgingRelease(cft);
}
-@interface I1 {
- I1 *myivar;
-}
+@interface I1
@end
@implementation I1
@implementation rdar10532449
@synthesize assign_prop, strong_readonly_prop, weak_prop;
@end
+
+void test2(id p, __strong I1 *ap[]) {
+ for (__strong I1 *specRule in p) {
+ }
+}