summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2017-08-15 12:40:01 +0000
committerAlex Lorenz <arphaman@gmail.com>2017-08-15 12:40:01 +0000
commit1e23dd63159369ef8275fa8ec63a2db3d704f426 (patch)
tree0dfb48405285e7c758ce6ccc5dd6fc8689e87dae /clang
parent6957ab5b7b98f7c372313eec6c81601bfa6b5860 (diff)
downloadbcm5719-llvm-1e23dd63159369ef8275fa8ec63a2db3d704f426.tar.gz
bcm5719-llvm-1e23dd63159369ef8275fa8ec63a2db3d704f426.zip
[Sema] Silence -Wobjc-missing-property-synthesis for unavailable properties
rdar://30296911 llvm-svn: 310916
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Sema/SemaObjCProperty.cpp2
-rw-r--r--clang/test/SemaObjC/default-synthesize-1.m16
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
OpenPOWER on IntegriCloud