Open
Description
[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.
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
[-]The restriction on what comparison operator function that can be explicitly defaulted[/-][+][dcl.fct.def.default] Restrictions on what comparison operator function that can be explicitly defaulted[/+]jensmaurer commentedon Mar 8, 2022
CWG2547
[-][dcl.fct.def.default] Restrictions on what comparison operator function that can be explicitly defaulted[/-][+][dcl.fct.def.default] Restrictions on what comparison operator function that can be explicitly defaulted CWG2547[/+][-][dcl.fct.def.default] Restrictions on what comparison operator function that can be explicitly defaulted CWG2547[/-][+][dcl.fct.def.default] Restrictions on what comparison operator function can be explicitly defaulted CWG2547[/+]