1 // { dg-do compile { target c++11 } } 2 3 #include <type_traits> 4 5 #define IS_LIT(T) (std::is_literal_type<T>::value) 6 #define SA(X) static_assert (X, #X) 7 #define YES(T) SA(IS_LIT(T)) 8 #define NO(T) SA(!IS_LIT(T)) 9 10 enum E1 { }; 11 enum class E2 { }; 12 struct Literal {}; 13 14 struct NotLiteral { 15 ~NotLiteral(); 16 }; 17 18 YES(int); 19 YES(int[]); 20 YES(int[3]); 21 YES(double); 22 YES(void *); 23 YES(decltype (nullptr)); 24 YES(int Literal::*); 25 YES(void (Literal::*)()); 26 YES(E1); 27 YES(E2); 28 YES(Literal); 29 NO (NotLiteral); 30 YES(NotLiteral *); 31 YES(NotLiteral NotLiteral::*); 32 YES(NotLiteral (NotLiteral::*)(NotLiteral)); 33 34 struct A { 35 A(const A&) = default; 36 A(int); 37 }; 38 39 NO(A); // no constexpr ctor other than copy 40