Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaObjCXX / is-base-of.mm
blob9cf16661b0c580ea1125c7a77e58d73b87f7b25b
1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
3 @interface NSObj
4 @end
6 @interface NSChild : NSObj
7 @end
9 static_assert(__is_base_of(NSObj, NSChild), "");
10 static_assert(!__is_base_of(NSChild, NSObj), "");
12 static_assert(__is_base_of(NSObj, NSObj), "");
14 static_assert(!__is_base_of(NSObj *, NSChild *), "");
15 static_assert(!__is_base_of(NSChild *, NSObj *), "");
17 static_assert(__is_base_of(const volatile NSObj, NSChild), "");
18 static_assert(__is_base_of(NSObj, const volatile NSChild), "");
20 @class NSForward; // expected-note{{forward declaration of class}}
22 static_assert(!__is_base_of(NSForward, NSObj), "");
23 static_assert(!__is_base_of(NSObj, NSForward), ""); // expected-error{{incomplete type 'NSForward'}}
25 static_assert(!__is_base_of(id, NSObj), "");