[Bug c++/94924] Default equality operator for C-array compares addresses, not data

2022-12-26 Thread rhalbersma at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94924

--- Comment #4 from rhalbersma  ---
Is there any chance that this bug fix can be backported to gcc 10 also?

[Bug c++/94924] Default equality operator for C-array compares addresses, not data

2021-04-22 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94924

Patrick Palka  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE
 CC||ppalka at gcc dot gnu.org

--- Comment #3 from Patrick Palka  ---
Looks like a dup of PR93480, which has been fixed for GCC 11.

*** This bug has been marked as a duplicate of bug 93480 ***

[Bug c++/94924] Default equality operator for C-array compares addresses, not data

2020-05-12 Thread rhalbersma at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94924

--- Comment #2 from rhalbersma  ---
OK, Alisdair Meredith points out on Twitter that in [class.compare.default]/6
there is a special sentence on array class data members

In that list, any subobject of array type is recursively expanded to the
sequence of its elements, in the order of increasing subscript.

So only direct array comparisons are deprecated.

[Bug c++/94924] Default equality operator for C-array compares addresses, not data

2020-05-12 Thread rhalbersma at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94924

--- Comment #1 from rhalbersma  ---
I just became aware of [depr.array.comp] in N4861

"Equality and relational comparisons (7.6.10, 7.6.9) between two operands of
array type are deprecated."

This is very surprising to say the least and disqualifies default op= for any
class containing a C-array. 

But in any case, should such code generate a warning message? And this bug be
closed?

[Bug c++/94924] Default equality operator for C-array compares addresses, not data

2020-05-05 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94924

Jonathan Wakely  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2020-05-06
 Status|UNCONFIRMED |NEW