Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/constexpr-trivial1.C

raw
1 // PR c++/70139
2 // { dg-options "-fno-elide-constructors" }
3 // { dg-do compile { target c++11 } }
4
5 template<class T, class U>
6 struct A
7 {
8 T a;
9 U b;
10 constexpr A () : a (), b () { }
11 constexpr A (const T &x, const U &y) : a (x), b (y) { }
12 };
13 struct B
14 {
15 constexpr B (const bool x) : c (x) {}
16 constexpr bool operator!= (const B x) const { return c != x.c; }
17 bool c;
18 };
19 constexpr static A<B, B*> d[] = { { B (true), nullptr }, { B (false), nullptr } };
20 static_assert (d[0].a != d[1].a, "");