https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70139

--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
template<class T, class U>
struct A
{
  T a;
  U b;
  constexpr A () : a (), b () { }
  constexpr A (const A &x) : a (x.a), b (x.b) { }
  constexpr A (const T &x, const U &y) : a (x), b (y) { }
};
struct B
{
  constexpr B (const bool x) : c (x) {}
  constexpr B (const B &x) : c (x.c) {}
  constexpr bool operator!= (const B x) const { return c != x.c; }
  bool c;
};
constexpr static A<B, B*> d[] = { { B (true), nullptr }, { B (false), nullptr }
};
static_assert (d[0].a != d[1].a, "");
works both with and without -fno-elide-constructors though, and it is the B
copy ctor that matters, the A copy ctor can be commented out.

Reply via email to