You should probably include -pedantic-errors in here too. On Jun 19, 2012, at 18:10 , Argyrios Kyrtzidis <[email protected]> wrote:
> Author: akirtzidis > Date: Tue Jun 19 20:10:40 2012 > New Revision: 158781 > > URL: http://llvm.org/viewvc/llvm-project?rev=158781&view=rev > Log: > [arcmt] When migrating to ARC disable -Werror so as to only block migration > for "hard" ARC errors, not warnings. > > rdar://11691437 > > Modified: > cfe/trunk/lib/ARCMigrate/ARCMT.cpp > cfe/trunk/test/ARCMT/checking.m > > Modified: cfe/trunk/lib/ARCMigrate/ARCMT.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/ARCMT.cpp?rev=158781&r1=158780&r2=158781&view=diff > ============================================================================== > --- cfe/trunk/lib/ARCMigrate/ARCMT.cpp (original) > +++ cfe/trunk/lib/ARCMigrate/ARCMT.cpp Tue Jun 19 20:10:40 2012 > @@ -195,8 +195,18 @@ > CInvok->getLangOpts()->ObjCAutoRefCount = true; > CInvok->getLangOpts()->setGC(LangOptions::NonGC); > CInvok->getDiagnosticOpts().ErrorLimit = 0; > - CInvok->getDiagnosticOpts().Warnings.push_back( > - > "error=arc-unsafe-retained-assign"); > + > + // Ignore -Werror flags when migrating. > + std::vector<std::string> WarnOpts; > + for (std::vector<std::string>::iterator > + I = CInvok->getDiagnosticOpts().Warnings.begin(), > + E = CInvok->getDiagnosticOpts().Warnings.end(); I != E; ++I) { > + if (!StringRef(*I).startswith("error")) > + WarnOpts.push_back(*I); > + } > + WarnOpts.push_back("error=arc-unsafe-retained-assign"); > + CInvok->getDiagnosticOpts().Warnings = WarnOpts; > + > CInvok->getLangOpts()->ObjCRuntimeHasWeak = HasARCRuntime(origCI); > > return CInvok.take(); > > Modified: cfe/trunk/test/ARCMT/checking.m > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/checking.m?rev=158781&r1=158780&r2=158781&view=diff > ============================================================================== > --- cfe/trunk/test/ARCMT/checking.m (original) > +++ cfe/trunk/test/ARCMT/checking.m Tue Jun 19 20:10:40 2012 > @@ -1,4 +1,4 @@ > -// RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 %s > +// RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 > -fblocks -Werror %s > // DISABLE: mingw32 > > #if __has_feature(objc_arc) > @@ -332,3 +332,13 @@ > self->x = [NSObject new]; // expected-error {{assigning retained object}} > } > @end > + > +@interface Test10 : NSObject > +@property (retain) id prop; > +-(void)foo; > +@end > + > +void test(Test10 *x) { > + x.prop = ^{ [x foo]; }; // expected-warning {{likely to lead to a retain > cycle}} \ > + // expected-note {{retained by the captured > object}} > +} > > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
