2 // { dg-do compile { target c++11 } }
5 constexpr explicit operator int() const { return 0; }
11 T t1 = a; // { dg-error "cannot convert" }
12 T t2 = {a}; // { dg-error "cannot convert" }
24 int n1 = t; // { dg-error "cannot convert" }
25 int n2 = {t}; // { dg-error "cannot convert" }
34 template void f<int>();
39 static constexpr A a{};
40 static constexpr T t1 = a; // { dg-error "cannot convert" }
41 static constexpr T t2 = {a}; // { dg-error "cannot convert" }
42 static constexpr T t4{a};
43 static constexpr T t5 = T(a);
44 static constexpr T t6 = T{a};
49 static constexpr T t{};
50 static constexpr int n1 = t; // { dg-error "cannot convert" }
51 static constexpr int n2 = {t}; // { dg-error "cannot convert" }
52 static constexpr int n4{t};
53 static constexpr int n5 = int(t);
54 static constexpr int n6 = int{t};
57 template struct B<int>;
60 #if __cpp_inline_variables
64 static inline T t1 = a; // { dg-error "cannot convert" "" { target c++17 } }
65 static inline T t2 = {a}; // { dg-error "cannot convert" "" { target c++17 } }
66 static inline T t4{a};
67 static inline T t5 = T(a);
68 static inline T t6 = T{a};
74 static inline int n1 = t; // { dg-error "cannot convert" "" { target c++17 } }
75 static inline int n2 = {t}; // { dg-error "cannot convert" "" { target c++17 } }
76 static inline int n4{t};
77 static inline int n5 = int(t);
78 static inline int n6 = int{t};
81 template struct D<int>;