From: Nico Weber Date: Sat, 27 Dec 2014 01:05:55 +0000 (+0000) Subject: Add more test coverage for the Objective-C deprected selector warning. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f5e535ed4c217a860fca95dbb6ad4f8839e2da14;p=clang Add more test coverage for the Objective-C deprected selector warning. 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 --- diff --git a/test/SemaObjC/attr-deprecated.m b/test/SemaObjC/attr-deprecated.m index 4d54d5da05..02acf2ced2 100644 --- a/test/SemaObjC/attr-deprecated.m +++ b/test/SemaObjC/attr-deprecated.m @@ -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. +}