view gcc/testsuite/g++.dg/cpp1y/constexpr-90383-1.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
line wrap: on
line source

// PR c++/90383
// { dg-do compile { target c++14 } }

struct alignas(8) A { constexpr A (bool x) : a(x) {} A () = delete; bool a; };
struct B { A b; };

constexpr bool
foo ()
{
  B w{A (true)};
  w.b = A (true);
  return w.b.a;
}

static_assert (foo (), "");