| 1 |
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s |
| 2 |
|
| 3 |
@interface NSObj |
| 4 |
@end |
| 5 |
|
| 6 |
@interface NSChild : NSObj |
| 7 |
@end |
| 8 |
|
| 9 |
static_assert(__is_base_of(NSObj, NSChild), ""); |
| 10 |
static_assert(!__is_base_of(NSChild, NSObj), ""); |
| 11 |
|
| 12 |
static_assert(__is_base_of(NSObj, NSObj), ""); |
| 13 |
|
| 14 |
static_assert(!__is_base_of(NSObj *, NSChild *), ""); |
| 15 |
static_assert(!__is_base_of(NSChild *, NSObj *), ""); |
| 16 |
|
| 17 |
static_assert(__is_base_of(const volatile NSObj, NSChild), ""); |
| 18 |
static_assert(__is_base_of(NSObj, const volatile NSChild), ""); |
| 19 |
|
| 20 |
@class NSForward; // expected-note{{forward declaration of class}} |
| 21 |
|
| 22 |
static_assert(!__is_base_of(NSForward, NSObj), ""); |
| 23 |
static_assert(!__is_base_of(NSObj, NSForward), ""); // expected-error{{incomplete type 'NSForward'}} |
| 24 |
|
| 25 |
static_assert(!__is_base_of(id, NSObj), ""); |