]> granicus.if.org Git - clang/commitdiff
Add more test coverage for the Objective-C deprected selector warning.
authorNico Weber <nicolasweber@gmx.de>
Sat, 27 Dec 2014 01:05:55 +0000 (01:05 +0000)
committerNico Weber <nicolasweber@gmx.de>
Sat, 27 Dec 2014 01:05:55 +0000 (01:05 +0000)
I broke this case in a local patch I'm writing, and there was no test to stop
me.  Now there is.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224873 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaObjC/attr-deprecated.m

index 4d54d5da057208495906967bcad3eec8fdaa00b0..02acf2ced22d71c5db8784b3db2ababa4f64483c 100644 (file)
@@ -258,3 +258,14 @@ const char * func() {
 }
 @end
 
+@implementation UndeclaredImpl // expected-warning{{cannot find interface declaration}}
+- (void)partiallyUnavailableMethod {}
+@end
+
+@interface InterfaceWithSameMethodAsUndeclaredImpl
+- (void)partiallyUnavailableMethod __attribute__((unavailable));
+@end
+
+void f(id a) {
+  [a partiallyUnavailableMethod]; // no warning, `a` could be an UndeclaredImpl.
+}