зеркало из https://github.com/microsoft/clang-1.git
[arcmt] Make -Warc-unsafe-retained-assign an error when migrating. rdar://8939557
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133627 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
5b27b6d131
Коммит
7bf952e601
|
@ -187,6 +187,8 @@ CompilerInvocation *createInvocationForMigration(CompilerInvocation &origCI) {
|
|||
CInvok->getPreprocessorOpts().addMacroDef(define);
|
||||
CInvok->getLangOpts().ObjCAutoRefCount = true;
|
||||
CInvok->getDiagnosticOpts().ErrorLimit = 0;
|
||||
CInvok->getDiagnosticOpts().Warnings.push_back(
|
||||
"error=arc-unsafe-retained-assign");
|
||||
CInvok->getLangOpts().ObjCNoAutoRefCountRuntime = !HasARCRuntime(origCI);
|
||||
|
||||
return CInvok.take();
|
||||
|
|
|
@ -253,3 +253,15 @@ void rdar9491791(int p) {
|
|||
void rdar9504750(id p) {
|
||||
RELEASE_MACRO(p); // expected-error {{ARC forbids explicit message send of 'release'}}
|
||||
}
|
||||
|
||||
// rdar://8939557
|
||||
@interface TestReadonlyProperty : NSObject
|
||||
@property(assign,readonly) NSObject *value;
|
||||
@end
|
||||
|
||||
@implementation TestReadonlyProperty
|
||||
@synthesize value;
|
||||
- (void)viewDidLoad {
|
||||
value = [NSObject new]; // expected-error {{assigning retained object}}
|
||||
}
|
||||
@end
|
||||
|
|
Загрузка…
Ссылка в новой задаче