Skip to content

[dcl.fct.def.default] Restrictions on what comparison operator function can be explicitly defaulted CWG2547 #5337

Open
@xmh0511

Description

@xmh0511

[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.

Activity

changed the title [-]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[/+] on Mar 8, 2022
jensmaurer

jensmaurer commented on Mar 8, 2022

@jensmaurer
Member
changed the title [-][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[/+] on Mar 8, 2022
changed the title [-][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[/+] on Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cwgIssue must be reviewed by CWG.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @xmh0511@jensmaurer

        Issue actions

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