1 // { dg-do compile { target c++11 } }
4 // Scalar types, trivial class types (Clause 9), arrays of such types and
5 // cv-qualified versions of these types (3.9.3) are collectively called
9 // A trivially copyable class is a class that:
10 // * has no non-trivial copy constructors (12.8),
11 // * has no non-trivial copy assignment operators (13.5.3, 12.8), and
12 // * has a trivial destructor (12.4).
13 // A trivial class is a class that has a trivial default constructor (12.1)
14 // and is trivially copyable.
16 #include <type_traits>
18 #define TRY(expr) static_assert (expr, #expr)
19 #define YES(type) TRY(std::is_trivial<type>::value); \
20 TRY(std::is_trivial<type[]>::value); \
21 TRY(std::is_trivial<const volatile type>::value)
22 #define NO(type) TRY(!std::is_trivial<type>::value); \
23 TRY(!std::is_trivial<type[]>::value); \
24 TRY(!std::is_trivial<const volatile type>::value)
32 typedef int (A::*pmf)();
37 struct F: public A { int i; };
39 struct G: public A { A a; };
54 struct D: public B { };
56 struct E: public B { int q; };
58 struct D2: public B { };
60 struct I: public D, public D2 { };
70 struct H: public C { };
75 struct J { virtual void f(); };
80 struct L: virtual K {};