You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
structb {
friendbooloperator==(b, b);
friendbooloperator==(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. friends (if that is the intended reading, maybe adding a note/example for this would help?).
The text was updated successfully, but these errors were encountered:
Full name of submitter (unless configured in github; will be published with the issue): Ambrose T.
[class.compare.default]p1 states:
Does this apply to the following
friend
declarations?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?).The text was updated successfully, but these errors were encountered: