blob: bf3d368418f0e9dc55c79b31e8a406bde7a9c4a9 [file] [log] [blame]
// PR c++/98469
// { dg-do compile { target c++20 } }
// { dg-options "-Wall" }
template<typename T, typename F>
constexpr T
bit_cast (const F &f) noexcept
{
return __builtin_bit_cast (T, f);
}
struct S { int s; };
constexpr int foo (const S &x) { return x.s; }
constexpr int bar () { return foo (bit_cast<S> (0)); }
constexpr int x = bar ();
static_assert (!x);