2 // { dg-do compile { target c++11 } }
7 constexpr T g(T t) { return f(t); } // { dg-error "f.int" }
11 constexpr int i = g(1); // { dg-error "g.T" }
14 // --------------------
16 struct complex // { dg-message "no constexpr constructor" }
18 complex(double r, double i) : re(r), im(i) { }
19 constexpr double real() const { return re; } // { dg-error "not a literal type" }
20 double imag() const { return im; }
27 constexpr complex co1(0, 1); // { dg-error "not literal" }
28 constexpr double dd2 = co1.real(); // { dg-error "non-constexpr function" }
30 // --------------------
32 struct base // { dg-message "no constexpr constructor" }
38 struct derived : public base // { dg-message "base class" }
40 constexpr derived(): base() { } // { dg-error "non-constexpr function" }
43 constexpr derived obj; // { dg-error "not literal" }
45 // --------------------
49 int _M_i; // { dg-message "does not initialize" }
51 constexpr Def() = default; // { dg-error "implicit declaration is not constexpr" }
54 constexpr Def defobj; // { dg-error "uninitialized" }