[Bug c++/95772] warning desired when default operator= cannot be constructued
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Jun 19 20:30:15 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95772
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Marc Pawlowsky from comment #0)
> I expected a diagnostic saying that operator= cannot be defaulted which is
> seen if the ASSIGN code is enabled. The code compiles cleanly.
As expected. The C++ standard is clear about what this code means. The
explicitly defaulted assignment operator is defined as deleted, because it
would be ill-formed.
Defaulting it doesn't mean it will be provided by the compiler.
> When I wrote this bug in a large code base with -03 and -flto the code will
> fail with illegal instructions and other memory corruption errors. No
> problem without optimization.
What bug? The type is not assignable, how can that fail at runtime?
More information about the Gcc-bugs
mailing list