[dcl.fct.def.default] Restrictions on what comparison operator function can be explicitly defaulted CWG2547 · Issue #5337 · cplusplus/draft (original) (raw)

[dcl.fct.def.default] p1 just states:

A function that is explicitly defaulted shall

  • be a special member function or a comparison operator function ([over.binary]), and
  • not have default arguments.

If I don't omit some other rules, there are no more restrictions on what the comparison operator function shall satisfy.

Consider this example:

enum E{}; bool operator==(E,E) = default;

This example directly causes GCC to crash while Clang reports some diagnoses for which I cannot find the corresponding wording in the standard.