[dcl.fct.def.default] Restrictions on what comparison operator function can be explicitly defaulted CWG2547
Nobody has claimed this yet.
- Dominant language
- TeX
- Stars
- 221
- Forks
- 813
- Avg merge
- 16h 4m
- Merged PRs (30d)
- 36
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with [dcl.fct.def.default] p1 and its reference to [over.binary], then examine the enum comparison example and the linked Compiler Explorer behavior in GCC and Clang. Determine what restrictions explicitly defaulted comparison operator functions should satisfy and what wording is needed to define the expected diagnostics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100