Now non-member functions can be defaulted, so this assert is wrong.
move_signature_fn_p already checks for ctor or op=.
PR c++/106361
gcc/cp/ChangeLog:
* decl.cc (move_fn_p): Remove assert.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/spaceship-eq14.C: New test.
bool
move_fn_p (const_tree d)
{
- gcc_assert (DECL_FUNCTION_MEMBER_P (d));
-
if (cxx_dialect == cxx98)
/* There are no move constructors if we are in C++98 mode. */
return false;
--- /dev/null
+// PR c++/106361
+// { dg-do compile { target c++20 } }
+
+struct foo {
+ int x;
+};
+
+struct bar {
+ foo f; // { dg-error "operator==" }
+ friend bool operator==(const bar& a, const bar& b);
+};
+
+bool operator==(const bar& a, const bar& b) = default;
+
+int main() {
+ return bar{} == bar{}; // { dg-error "deleted" }
+}