blob: a7a52116da88160fab4d993cc386de9413e8ee47 [file] [log] [blame]
Anders Carlsson67e4dd22009-03-22 01:52:17 +00001// RUN: clang -fsyntax-only -verify %s -std=c++0x
2
3#ifndef __GXX_EXPERIMENTAL_CXX0X__
4#define __CONCAT(__X, __Y) __CONCAT1(__X, __Y)
5#define __CONCAT1(__X, __Y) __X ## __Y
6
7#define static_assert(__b, __m) \
8 typedef int __CONCAT(__sa, __LINE__)[__b ? 1 : -1]
9#endif
10
11class C {
12 virtual void f() = 0;
13};
14
15static_assert(__is_abstract(C), "C has a pure virtual function");
16
17class D : C {
18};
19
20static_assert(__is_abstract(D), "D inherits from an abstract class");
21
22class E : D {
23 virtual void f();
24};
25
26static_assert(!__is_abstract(E), "E inherits from an abstract class but implements f");