2 // { dg-options -std=c++0x }
4 // bang is ill-formed (diagnostic required) because its initializer is
5 // non-constant, because it uses the value of an uninitialized object.
7 // s() is ill-formed (no diagnostic required) because there is no set of
8 // arguments that would produce a constant expression.
10 // R() is well-formed because i is initialized before j.
13 constexpr s() : v(v) { } // { dg-message "" }
17 constexpr s bang; // { dg-message "" }
21 constexpr R() : i(42),j(i) { } // { dg-bogus "" "" { xfail *-*-* } }
24 constexpr R r; // { dg-bogus "" "" { xfail *-*-* } }
26 // Ill-formed (no diagnostic required)
29 constexpr int f() { return i; }
30 constexpr T(): i(0) { }
31 constexpr T(const T& t) : i(f()) { } // { dg-message "" }
35 // Ill-formed (diagnostic required)
36 constexpr T t2(t1); // { dg-message "" }
41 constexpr int f(int _i) { return _i; }
42 constexpr int g() { return i; }
43 constexpr U(): i(0), j(0) { }
44 constexpr U(const U& t) : i(f(t.i)),j(0) { } // { dg-bogus "" "" { xfail *-*-* } }
45 constexpr U(int _i) : i(_i),j(g()) { } // { dg-bogus "" "" { xfail *-*-* } }
49 constexpr U u2(u1); // { dg-bogus "" "" { xfail *-*-* } }
50 constexpr U u3(1); // { dg-bogus "" "" { xfail *-*-* } }