[Bug c++/95608] New: c++20 wrong code for defaulted equality comparison on array member variables
vermaelen.wouter at gmail dot com
gcc-bugzilla@gcc.gnu.org
Tue Jun 9 16:05:30 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95608
Bug ID: 95608
Summary: c++20 wrong code for defaulted equality comparison on
array member variables
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: vermaelen.wouter at gmail dot com
Target Milestone: ---
The generated code does not actually compare the content of the array. It does
with clang and msvc.
-----------------
https://godbolt.org/z/VkuVXj
-----------------
struct S {
int a[5];
bool operator==(const S&) const = default;
};
bool f(const S& x, const S& y) {
return x == y;
}
-----------------
More information about the Gcc-bugs
mailing list