// { dg-do compile { target c++23 } } #include struct E { E() = default; E(E&&) = default; }; void test_pr105146() { std::bad_expected_access(E{}); } void test_lwg4031() { struct test_type : std::bad_expected_access { }; static_assert( std::is_nothrow_default_constructible_v ); // LWG 4031. bad_expected_access member functions should be noexcept static_assert( std::is_nothrow_copy_constructible_v ); static_assert( std::is_nothrow_move_constructible_v ); static_assert( std::is_nothrow_copy_assignable_v ); static_assert( std::is_nothrow_move_assignable_v ); }