Open
Description
Full name of submitter (unless configured in github; will be published with the issue): Ambrose T.
[class.compare.default]p1 states:
A definition of a comparison operator as defaulted that appears in a class shall be the first declaration of that function
Does this apply to the following friend
declarations?
struct b {
friend bool operator==(b, b);
friend bool operator==(b, b) = default;
};
I’m mainly asking because Clang and EDG diagnose this as an error whereas GCC and MSVC accept this code. At the same time, it’s already invalid for members to be redeclared in a class, so by that logic the fact that this sentence is even there would indicate that it should (also) apply to non-members, i.e. friend
s (if that is the intended reading, maybe adding a note/example for this would help?).
Metadata
Metadata
Assignees
Labels
No labels