| 1 |
// RUN: %clang_cc1 -fsyntax-only -DBOTH -verify %s |
| 2 |
// If the decls come from a pch, the behavior shouldn't change: |
| 3 |
// RUN: %clang_cc1 -x objective-c-header %s -emit-pch -o %t |
| 4 |
// RUN: %clang_cc1 -DUSES -include-pch %t -fsyntax-only -verify %s |
| 5 |
// expected-no-diagnostics |
| 6 |
|
| 7 |
// The slightly strange ifdefs are so that the command that builds the gch file |
| 8 |
// doesn't need any -D switches, for these would get embedded in the gch. |
| 9 |
|
| 10 |
#ifndef USES |
| 11 |
@interface Interface1 |
| 12 |
- (void)partiallyUnavailableMethod; |
| 13 |
@end |
| 14 |
@interface Interface2 |
| 15 |
- (void)partiallyUnavailableMethod __attribute__((unavailable)); |
| 16 |
@end |
| 17 |
#endif |
| 18 |
|
| 19 |
#if defined(USES) || defined(BOTH) |
| 20 |
void f(id a) { |
| 21 |
[a partiallyUnavailableMethod]; // no warning, `a` could be an Interface1. |
| 22 |
} |
| 23 |
#endif |