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

--- Comment #1 from Nathaniel Shead <natattak at gmail dot com> ---
On further investigation, I suspect this is more general than just
`-Wunused-parameter`; the error looks to be caused by any error occurring
within `operator<`. For example,

  #include <compare>
  #include <functional>

  struct S {};
  auto operator<=>(S, S) = default;

  template <typename Lhs, typename Rhs>
  auto operator<(Lhs&&, Rhs&& rhs) {
    return rhs.nonexistent;
  }

  int main() {
    return std::less{}(S{}, S{});
  }

produces the same issue.

I also discovered that the issue is only when the templated `operator<` has
deduced type.

Reply via email to