summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2014-12-27 07:09:37 +0000
committerNico Weber <nicolasweber@gmx.de>2014-12-27 07:09:37 +0000
commite3b11043d0930fb36458e0a693f6ae47546cd08b (patch)
tree6093a6002d00efac8bed6d3c6f4e407902d5faee /clang/test/SemaObjC
parentdd84ec5fd9b0a2fe6d9611c53bad36291bc97c0e (diff)
downloadbcm5719-llvm-e3b11043d0930fb36458e0a693f6ae47546cd08b.tar.gz
bcm5719-llvm-e3b11043d0930fb36458e0a693f6ae47546cd08b.zip
Objective-C: Tweak unavailability warning.
Don't warn when a selector has an unavailable and an available variant, and the first also has an implementation. llvm-svn: 224881
Diffstat (limited to 'clang/test/SemaObjC')
-rw-r--r--clang/test/SemaObjC/attr-deprecated.m21
1 files changed, 17 insertions, 4 deletions
diff --git a/clang/test/SemaObjC/attr-deprecated.m b/clang/test/SemaObjC/attr-deprecated.m
index 416e4641011..13ba68db58e 100644
--- a/clang/test/SemaObjC/attr-deprecated.m
+++ b/clang/test/SemaObjC/attr-deprecated.m
@@ -263,11 +263,24 @@ const char * func() {
@end
@interface InterfaceWithSameMethodAsUndeclaredImpl
-- (void)partiallyUnavailableMethod __attribute__((unavailable)); // expected-note{{explicitly marked unavailable here}}
+- (void)partiallyUnavailableMethod __attribute__((unavailable));
@end
void f(id a) {
- // FIXME: Warning on this looks incorrect, since `a` could be an
- // UndeclaredImpl object, where this method isn't inavailable.
- [a partiallyUnavailableMethod]; // expected-error{{is unavailable}}
+ [a partiallyUnavailableMethod]; // no warning, `a` could be an UndeclaredImpl.
+}
+
+@interface InterfaceWithImplementation
+- (void)anotherPartiallyUnavailableMethod;
+@end
+@implementation InterfaceWithImplementation
+- (void)anotherPartiallyUnavailableMethod {}
+@end
+
+@interface InterfaceWithSameMethodAsInterfaceWithImplementation
+- (void)anotherPartiallyUnavailableMethod __attribute__((unavailable));
+@end
+
+void g(id a) {
+ [a anotherPartiallyUnavailableMethod]; // no warning, `a` could be an InterfaceWithImplementation.
}
OpenPOWER on IntegriCloud