From f5e535ed4c217a860fca95dbb6ad4f8839e2da14 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Sat, 27 Dec 2014 01:05:55 +0000 Subject: [PATCH] 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 --- test/SemaObjC/attr-deprecated.m | 11 +++++++++++ 1 file changed, 11 insertions(+) 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. +} -- 2.40.0