diff options
| author | Douglas Gregor <dgregor@apple.com> | 2013-01-08 18:16:18 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2013-01-08 18:16:18 +0000 |
| commit | c4c1fb39d8bd4ecd559f2dd3ed1293672cb350f9 (patch) | |
| tree | a6cf3aad0d82b49ba731b295ac41072ad1d35e82 /clang | |
| parent | 7e6a7a19e358e2a3361db45a0bedf3ca4e9a0291 (diff) | |
| download | bcm5719-llvm-c4c1fb39d8bd4ecd559f2dd3ed1293672cb350f9.tar.gz bcm5719-llvm-c4c1fb39d8bd4ecd559f2dd3ed1293672cb350f9.zip | |
Use Decl::getAvailability() rather than checking for the "unavailable"
attribute when determining whether we need to see an implementation of
a property. Fixes <rdar://problem/12958191>.
llvm-svn: 171877
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Sema/SemaObjCProperty.cpp | 3 | ||||
| -rw-r--r-- | clang/test/SemaObjC/no-warning-unavail-unimp.m | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index 170bbde370c..a605ed52a67 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/lib/Sema/SemaObjCProperty.cpp @@ -1605,7 +1605,8 @@ void Sema::DiagnoseUnimplementedProperties(Scope *S, ObjCImplDecl* IMPDecl, // Is there a matching propery synthesize/dynamic? if (Prop->isInvalidDecl() || Prop->getPropertyImplementation() == ObjCPropertyDecl::Optional || - PropImplMap.count(Prop) || Prop->hasAttr<UnavailableAttr>()) + PropImplMap.count(Prop) || + Prop->getAvailability() == AR_Unavailable) continue; if (!InsMap.count(Prop->getGetterName())) { Diag(IMPDecl->getLocation(), diff --git a/clang/test/SemaObjC/no-warning-unavail-unimp.m b/clang/test/SemaObjC/no-warning-unavail-unimp.m index d5a4eac9906..037bf24ce92 100644 --- a/clang/test/SemaObjC/no-warning-unavail-unimp.m +++ b/clang/test/SemaObjC/no-warning-unavail-unimp.m @@ -1,9 +1,11 @@ -// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fsyntax-only -verify -Wno-objc-root-class %s // expected-no-diagnostics // rdar://9651605 +// rdar://12958191 @interface Foo @property (getter=getVal) int val __attribute__((unavailable)); +@property (getter=getVal) int val2 __attribute__((availability(macosx,unavailable))); - Method __attribute__((unavailable)); + CMethod __attribute__((unavailable)); @end |

