// { dg-do compile { target c++17 } } // LWG 2762 adds noexcept to operator-> and operator* #include struct S { void can_throw(); void cannot_throw() noexcept; }; static_assert( ! noexcept(std::declval&>()->can_throw()) ); static_assert( noexcept(std::declval&>()->cannot_throw()) ); static_assert( noexcept(std::declval&>().operator->()) ); static_assert( noexcept(std::declval&>().operator->()) ); static_assert( noexcept(*std::declval&>()) ); static_assert( noexcept(*std::declval&>()) ); static_assert( noexcept(*std::declval&&>()) ); static_assert( noexcept(*std::declval&&>()) );