diff options
-rw-r--r-- | clang/lib/Sema/SemaObjCProperty.cpp | 2 | ||||
-rw-r--r-- | clang/test/SemaObjC/default-synthesize-1.m | 16 |
2 files changed, 16 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index e1e85dfd5e5..d0b59eb7895 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/lib/Sema/SemaObjCProperty.cpp @@ -1895,7 +1895,7 @@ void Sema::DefaultSynthesizeProperties(Scope *S, ObjCImplDecl *IMPDecl, /* property = */ Prop->getIdentifier(), /* ivar = */ Prop->getDefaultSynthIvarName(Context), Prop->getLocation(), Prop->getQueryKind())); - if (PIDecl) { + if (PIDecl && !Prop->isUnavailable()) { Diag(Prop->getLocation(), diag::warn_missing_explicit_synthesis); Diag(IMPDecl->getLocation(), diag::note_while_in_implementation); } diff --git a/clang/test/SemaObjC/default-synthesize-1.m b/clang/test/SemaObjC/default-synthesize-1.m index 731aa863e10..573434b3b32 100644 --- a/clang/test/SemaObjC/default-synthesize-1.m +++ b/clang/test/SemaObjC/default-synthesize-1.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -Wobjc-missing-property-synthesis -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 -fsyntax-only -Wobjc-missing-property-synthesis -verify -Wno-objc-root-class -triple=x86_64-apple-macos10.10 %s // rdar://11295716 @interface NSObject @@ -141,3 +141,17 @@ return _description; // expected-error {{use of undeclared identifier '_description'}} } @end + +@interface DontWarnOnUnavailable + +// No warning expected: +@property (nonatomic, readonly) int un1 __attribute__((unavailable)); +@property (readwrite) int un2 __attribute__((availability(macos, unavailable))); + +@property (readwrite) int un3 __attribute__((availability(ios, unavailable))); // expected-warning {{auto property synthesis is synthesizing property not explicitly synthesized}} + +@end + +@implementation DontWarnOnUnavailable // expected-note {{detected while default synthesizing properties in class implementation}} + +@end |